Results 1 to 3 of 3
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How do I remove my autonumbering via code? (WordXP SP3)

    brief history...
    The Word document template was corrupt. The style that has become corrupt 'Heading 2 Line 4' its placed automatic numbering and as a result when this document prints this style doesnt print the borderline.

    current status...
    Ive cleaned up the template. However there were documents created with the corrupt template and corrupt style.

    When these old documents are opened up I would like to clean up this style by removing the automatic numbering.

    Ive recorded a macro. These are my steps:
    Select the style> goto the menu Format>Styles and Formatting> 'Heading 2 Line 4'> Modify> Format>Numbering>select None>Ok

    However when I read the recorded macro there is no reference to remove the auto-numbering. please see recorded macro.
    Have I missed something? Or is removing the auto-numbering a different syntax?



    ActiveDocument.Styles("Header 2 Line 4").LinkToListTemplate ListTemplate:= _
    Nothing
    With ActiveDocument.Styles("Header 2 Line 4")
    .AutomaticallyUpdate = False
    .BaseStyle = "Header 2 Line 3"
    .NextParagraphStyle = "Header 2 Line 4"
    End With

    diana

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: How do I remove my autonumbering via code? (Wo

    Does your code fix the style itself and just not update the document? You could manually re-apply the fixed style, or manually remove the numbering. Something like this will remove the numbering and could be combined with a search loop:

    Selection.Range.ListFormat.RemoveNumbers NumberType:=wdNumberParagraph

  3. #3
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How do I remove my autonumbering via code? (Wo

    The code fixes the style in that current document.

    I'll give your code ago & see how i go.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •