Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    922
    Thanks
    2
    Thanked 12 Times in 11 Posts

    OutlineLevel (Word 2003)

    I want to determine whether a user-defined style has numbering. If the IP is in one of the Heading family of styles, I can easily test to determine the outline level:

    MsgBox Selection.Paragraphs(1).OutlineLevel

    But if I've created a style called, for example, "Test", this code returns 10, indicating that it's body level.

    ActiveDocument.Styles("Test").ParagraphFormat.Outl ineLevel

    Style Test has been modified to contain numbering; the Modify Styles dialog displays "Outline Level 1", but the above code does not see that. (On the Format > Paragraph dialog, outline level is Body Text for style Test; for Heading 1, the outline level is disabled.)

    Questions: How do I determine whether a style has outline numbering? And if it does, how can I effectively remove it?

    Thanks.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: OutlineLevel (Word 2003)

    You can set the Outline level independently of Outline numbering. The instruction

    Selection.Range.ListFormat.ListLevelNumber

    will return the numbering level for the selection. If you want to look at the style:

    Selection.Style.ListLevelNumber

    ListLevelNumber is read/write for the ListFormat object but read-only for the Style object. To remove numbering from a style:

    Selection.Style.LinkToListTemplate ListTemplate:=Nothing

  3. #3
    5 Star Lounger
    Join Date
    Mar 2001
    Location
    New York, NY
    Posts
    922
    Thanks
    2
    Thanked 12 Times in 11 Posts

    Re: OutlineLevel (Word 2003)

    Thank you very much. It's ListLevelNumber , not OutlineLevel, that I want. to read.

    The code you've suggested to remove numbering works well. Thanks.

    Richard

Posting Permissions

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