Solved

VBA - modify outline numbering in Word

Posted on 2010-08-30
5
912 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 500 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
PDF to Word 25 103
Word 2016 - Overlay portion of screenshot 7 48
Using tables with MS Word 16 58
Convert .PDF 6 38
It is often necessary in this forum and others to illustrate Word fields as text with the field delimiters replaced with the curly brackets that the delimiters resemble when field codes are being displayed on the document. This means that the text c…
This article describes how to use the Send to Mail Recipient command. The instructions apply generally to Office 2007 and later versions, but Microsoft® Word 2013 was used for the specific steps and figures.  What is Send to Mail Recipient? Send…
In a previous video Micro Tutorial here at Experts Exchange (http://www.experts-exchange.com/videos/1358/How-to-get-a-free-trial-of-Office-365-with-the-Office-2016-desktop-applications.html), I explained how to get a free, one-month trial of Office …
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 …

708 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now