Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Apr 2003
    Location
    Kansas City, Missouri
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Hiding one style changes outline numbering (Word 2003)

    It seems that automatic numbering always gets me, even when I'm not working with them. Attached is a zipped file with a document and its concomitant template. The document should explain what is going on, but I'll sum up.

    I use VBA to remove styles that are not supposed to be used. In the case of user-defined styles, they are outright deleted. In the case of built-in styles, I simply hide them (thanks be to the MVPs for guiding me in that direction). But when I hide the "Article / Section" style, it affects my Heading 1 and Heading 2. I know there is something I'm not catching in this, but I can't figure out what it is.

    What is it about Word that is causing this behavior?

    Kevin Elmore
    Attached Files Attached Files

  2. #2
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Hiding one style changes outline numbering (Wo

    I can't work out why this is happening either but the following is a kludge to resolve the problem. Try replacing the End Sub line in your macro with this code snippet.
    <pre>'Fix problem with the numbering appearing upon hiding Article style
    GoFigger
    End Sub
    Sub GoFigger()
    Dim intLoop As Integer, sStyle As String
    For intLoop = 1 To 9
    sStyle = "Heading " & intLoop
    ActiveDocument.Styles(sStyle).LinkToListTemplate ListTemplate:=Nothing
    Next intLoop
    End Sub</pre>

    I'll have another look at this later but I'm not confident I will be able to resolve where the issue is coming from. Have you tried this code against a brand new blank file?
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  3. #3
    5 Star Lounger
    Join Date
    May 2001
    Location
    Stuttgart, Baden-W, Germany
    Posts
    931
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hiding one style changes outline numbering (Wo

    I thought it might be caused by using "myStyle.Hidden = True" instead of "myStyle.Visibility = False".
    The former was never really documented, as far as I know.

    But both show the same problem/bug...

    "Article / Section" is a list style... My next guess was that the list template was linked to the heading styles, but that doesn't seem to be the case, either.

    <img src=/S/frown.gif border=0 alt=frown width=15 height=15> <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15> Klaus

  4. #4
    Star Lounger
    Join Date
    Apr 2003
    Location
    Kansas City, Missouri
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hiding one style changes outline numbering (Wo

    <hr>Have you tried this code against a brand new blank file?<hr>

    It did the same thing with the blank file.

    The code worked like a charm, Andrew. I hate that it's a kludge fix, but if this problem has stumped both you and Klaus, then kludge may be the way to go. And at least it makes me feel a little better about my knowledge in Word.

    As I told my boss, Microsoft has not yet simplified two important aspects of Word: Tables and numbered lists. And it scares me that numbered lists can continue to be a problem when you're not even dealing directly with them.

    Kevin

Posting Permissions

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