• List format renumber also redefines style

    Home » Forums » AskWoody support » Productivity software by function » MS Word and word processing help » List format renumber also redefines style

    Author
    Topic
    #498458

    I discovered this in VBA, but it happens with vanilla Word too. I’m including code at the end anyway, but I don’t think it’s the code that’s the problem.

    I have a couple of styles called “Alpha List” and “Number List.” The Number List style has a left indent of 0.12″. When I right-click on a paragraph of that style and choose to set the numbering value, it updates the style. It does ask me first: ‘Changing the number format for this list updates the style “Number List” and reapplies the style to each paragraph. Do you want to continue?”

    When I choose Yes, the style changes to a left indent of 0.37″. Now each new paragraph I format to Number List (as well as paragraphs already formatted) has the new indent.

    What am I missing in Word?

    As stated before, here’s the code I was using when I noticed the problem, but it happens even without VBA, so I doubt that’s the issue. I suspect it’s doing the exact thing as the manual process except that it doesn’t prompt a message box.

    Code:
    Sub RestartNumbering()
    Dim myLF As ListFormat
    
    On Error GoTo Restart_Numbering_Error
    
        If Selection.Range.Style = “Alpha List” Or _
            Selection.Range.Style = “Number List” Then
    
    
    
            Set myLF = Selection.Range.ListFormat
            myLF.ApplyListTemplate ListTemplate:=myLF.ListTemplate, _
                ContinuePreviousList:=False
                
        Else
        
            MsgBox “Selection is not an approved numbered or alpha list.  ” & _
                “Please select a numbered or alpha list and try again.”, vbExclamation, _
                “Not a valid list”
    
        End If
    
    End Sub
    Viewing 2 reply threads
    Author
    Replies
    • #1487647

      Numbering lists are best set linked to styles. The ones you are working with apparently were.
      http://web.archive.org/web/20130510174814/http://www.shaunakelly.com/word/numbering/numbering20072010.html

      The idea of styles is uniform formatting of like-purposed text.

    • #1487648

      Hoping to deconstruct what’s happening with my styles. When I examine the Number List style the way it should be set, I have the following settings:

      Font: (Default) Verdana, 11 pt, Indent:
      Left: 0.12″
      Hanging: 0.25″, Left
      Line spacing: single, Widow/Orphan control, Numbered + Level: 1 + Numbering Style: 1, 2, 3, … + Start at: 1 + Alignment: Left + Aligned at: 0.37″ + Indent at: 0.62″, Style: Quick Style

      After I restart numbering, the settings change to:

      Font: (Default) Verdana, 11 pt, Indent:
      Left: 0.37″
      Hanging: 0.25″, Left
      Line spacing: single, Widow/Orphan control, Numbered + Level: 1 + Numbering Style: 1, 2, 3, … + Start at: 1 + Alignment: Left + Aligned at: 0.37″ + Indent at: 0.62″, Style: Quick Style

      It seems like the 0.37″ at the second alignment is affecting this, but I’m not sure how to fix that.

    • #1488764

      The fix is to set the indents in the numbering, not the paragraph or, if the paragraph indent is already set, make the start-at value for the number level the same as the indent. When they are the same, you’ll get the same indent when you restart of change the number value.

      When you set the number level’s start-at and link a paragraph style to it, Word changes the paragraph indent to the same value–if a paragraph indent has not been set. Setting a paragraph indent does not affect a number level start-at value though.

    Viewing 2 reply threads
    Reply To: List format renumber also redefines style

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: