[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

VBA - modify outline numbering in Word

Posted on 2010-08-30
5
Medium Priority
?
938 Views
Last Modified: 2012-05-10
Hi Experts

I have various automatic paragraph numbering suites defined using Styles in a template.  More than one scheme may be used in a single document.  I want to modify the values for 'aligned at', 'tab space after' and 'indent at' for each of the suites programatically.  Please can you tell me how to go about it?  I just cannot work out how to get to modify those values.

I am using Word 2003.  Each schemes numbering settings are set from the first level Style and have a value in the 'ListNum' field.

Many thanks for your help.
0
Comment
Question by:MonteDelMar
  • 3
  • 2
5 Comments
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 33566096
I'm not sure that I fully understand, but perhaps we could start here.
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 33566098
I forgot the code:
Sub FormatNumbering()
    Dim lv As ListLevel
    Dim i As Integer
    
    With ActiveDocument.Styles("Style1").ListTemplate
        For i = 1 To 9
            Set lv = .ListLevels(i)
            lv.TextPosition = CentimetersToPoints(1)
            lv.TabPosition = CentimetersToPoints(1)
        Next i
    End With
    
End Sub

Open in new window

0
 

Author Comment

by:MonteDelMar
ID: 33679851
Hi Graham

I am sorry to have neglected to reply to you before now & am grateful for your help as ever.

Just to clarify my question:

I have created 9 Styles e.g. Lev1, Lev2 etc.

I choose Format Style & the Lev1 Styles and then choose Format Numbering and set up my paragraph numbering, linking each level to one of those 9 Styles.

I need to change some of the settings for each level.

The code you posted does allow me to change the settings.  If I run it then the numbering definitions reflect the changes.  However, the apperance of any text in the corresponding Style does not update, even when I block it & reset it (Ctrl+Q).  If I delete the existing text & type new, it still does not implement the changes made to the numbering definition.

I cannot find an option to change the 'aligned at' value either.

I feel as though I am missing something obvious and hoping that you can tell me what it is.
0
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 2000 total points
ID: 33702894
I am trying to create your situation, but I cannot be certain that I am doing exactly what you are.

There is some modified code below. If it doesn't do what you need, could you post your document here, please, so that I can be sure that we are talking about the same thing?

Meanwhile, if you haven't already seen it, you might be interested in this article.

http://word.mvps.org/faqs/numbering/NumberingExplained/ApplyingNumbering/StyleBasedNumbering.htm
0
 

Author Closing Comment

by:MonteDelMar
ID: 33723837
Hi Graham

I think that there may have been some corruption in the document.  Unfortunately I cannot post it but the code you suggested certainly did alter the settings mentioned even though it was not reflected in the appearance of the document.  

Thank you for your help.

0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A few years ago I was very much a beginner at VBA, and that very much remains the case today.  I'll do my best to explain things as I go in the hope that other beginners can follow.  If you just want to check out a tool that creates a Select Case fu…
Microsoft Word is a program we have all encountered at some point, but very few of us have dug deep into its full scope of features, let alone customized it to suit our needs. Luckily making the ribbon (aka toolbar, first introduced in Word 2007) wo…
This video walks the viewer through the process of creating envelopes and labels, with multiple names and addresses. Navigate to the “Start Mail Merge” button in the Mailings tab: Follow the step-by-step process until asked to find the address doc…
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …
Suggested Courses
Course of the Month17 days, 14 hours left to enroll

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question