Save multilevel list with headings

Jeff H
4StarLounger
Posts: 427
Joined: 31 Oct 2017, 20:07

Save multilevel list with headings

Post by Jeff H »

I’ve worked with Word’s styles and multilevel lists for many years, and always associate the levels with Headings 1-9. I use different numbering schemes for different purposes, but then I often end up having to redefine the entire list.

Is there a way to save a few lists with their Heading associations so I can just apply and re-apply any of my multilevel lists in any new document from the template, without having to reassign the Heading associations? Currently using Word 365.

Thanks,
- Jeff

User avatar
Charles Kenyon
5StarLounger
Posts: 677
Joined: 10 Jan 2016, 15:56
Location: Madison, Wisconsin

Re: Save multilevel list with headings

Post by Charles Kenyon »

Word for Windows?

I assume you are using Shawna Kelly's method. http://www.shaunakelly.com/word/numberi ... 72010.html
You need not use the built-in heading styles, although they can be useful for other reasons. See https://www.addbalance.com/usersguide/1 ... Styles.htm.
You would, though, want to use the same set of styles in all documents to use any of these methods except having separate document templates.
Last edited by Charles Kenyon on 21 Nov 2024, 17:49, edited 1 time in total.

Jeff H
4StarLounger
Posts: 427
Joined: 31 Oct 2017, 20:07

Re: Save multilevel list with headings

Post by Jeff H »

Thanks Charles. Yes, I was a big fan of Shauna Kelly!
You've given me quite a bit here. I will go through this list and report back what I find.

- Jeff

User avatar
Charles Kenyon
5StarLounger
Posts: 677
Joined: 10 Jan 2016, 15:56
Location: Madison, Wisconsin

Re: Save multilevel list with headings

Post by Charles Kenyon »

I've tested each of the methods except modifying Greg's macro.
I've tested Greg's macro as well, just not changing it.
It does use custom paragraph styles instead of the built-in heading styles.

Jeff H
4StarLounger
Posts: 427
Joined: 31 Oct 2017, 20:07

Re: Save multilevel list with headings

Post by Jeff H »

This is great, Charles. I think the best solution for me is your second bullet, custom templates, although I'm continuing to explore the other references.

This is not the first time I've wrestled with this problem, and in the past I've actually used custom templates to standardize specific multilevel outline numbering schemes that I like. Thanks to your article, I actually discovered my earlier templates in the Custom Office Templates folders. I'd lost them because I ended up with two folders by that name and Word was pointing to the wrong one, and then I'd completely forgotten what I had done and where the templates were.

Your article gives me the control I need to produce clean, useable templates and maintain access to them. (Not to mention your admonitions about the importance of "clean and usable" original templates.) Thanks!

- Jeff

User avatar
Charles Kenyon
5StarLounger
Posts: 677
Joined: 10 Jan 2016, 15:56
Location: Madison, Wisconsin

Re: Save multilevel list with headings

Post by Charles Kenyon »

You are welcome.

In recent versions of Word it is possible to pin templates under File > New (backstage).
I use a registry edit to have my custom templates show by default instead of the ones from Microsoft.
https://www.addbalance.com/usersguide/f ... istry_Hack

User avatar
HansV
Administrator
Posts: 80088
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Save multilevel list with headings

Post by HansV »

I split off some replies from this thread to a new one: Using Templates and Onedrive
(Thanks, Charles)
Best wishes,
Hans

User avatar
Charles Kenyon
5StarLounger
Posts: 677
Joined: 10 Jan 2016, 15:56
Location: Madison, Wisconsin

Re: Save multilevel list with headings

Post by Charles Kenyon »

Here is my discussion on the Answers site about using [Quick] Style Sets for MultiLevel Lists.
[Quick] Style Sets can contained MultiLevel Numbering. https://answers.microsoft.com/en-us/mso ... 17dbc1936b
That describes how it can be done, especially the March 12 post.

Here is a link to a download with 71 such sets:
https://addbalance.com/word/download.ht ... eNumbering
That is a work in progress. Current version is 24.3.

User avatar
macropod
4StarLounger
Posts: 524
Joined: 17 Dec 2010, 03:14

Re: Save multilevel list with headings

Post by macropod »

You could define and configure multiple multi-level list styles rather than relying only on Word's built-in heading styles.

For example, you could a set of ListNumber Styles using a macro like:

Code: Select all

Sub CreateListNumberStyles() 
Dim i As Long, s As Long, bStl As Boolean: bStl = False 
For i = 1 To 5 
  With ActiveDocument 
    For s = 1 To .Styles.Count 
      If .Styles(i).NameLocal = "ListNum " & i Then 
        bStl = True: Exit For 
      End If 
    Next 
    If bStl = False Then 
      .Styles.Add Name:="ListNum " & i, Type:=wdStyleTypeParagraph 
      With .Styles("ListNum " & i) 
        With .ParagraphFormat 
          .Alignment = wdAlignParagraphJustify
          .LineSpacingRule = wdLineSpaceSingle
          .LeftIndent = InchesToPoints(0) 
          .RightIndent = InchesToPoints(0) 
          .SpaceBefore = 0 
          .SpaceAfter = 12 
          .WidowControl = True 
          .KeepWithNext = False 
          .KeepTogether = False 
          .PageBreakBefore = False 
          .NoLineNumber = False 
          .Hyphenation = True 
          .FirstLineIndent = InchesToPoints(0) 
          .OutlineLevel = wdOutlineLevelBodyText 
          .CharacterUnitLeftIndent = 0 
          .CharacterUnitRightIndent = 0 
          .CharacterUnitFirstLineIndent = 0 
          .LineUnitBefore = 0 
          .LineUnitAfter = 0 
        End With 
        .Font.NameAscii = "Calibri" 'This line sets the heading font
        .Font.Size = 17 - i ' This line sets the heading point size, at 16pt for the 1st level, then decreasing by 1pt per level
        .Font.Bold = True ' This line makes the heading bold
      End With 
    End If 
  End With 
Next 
End Sub
Having created the Styles, you could configure their numbering schemes with code like

Code: Select all

Sub ApplyMultiLevelListNumbers() 
Dim LT As ListTemplate, i As Long, j As Long: j = 0 
Set LT = ActiveDocument.ListTemplates.Add(OutlineNumbered:=True) 
For i = 1 To 5 
  With LT.ListLevels(i) 
    .NumberFormat = Choose(i, "%1", "%1.%2", "%1.%2.%3", "%1.%2.%3(%4)", "%1.%2.%3(%4)(%5)") 
    .TrailingCharacter = wdTrailingTab 
    .NumberStyle = Choose(i, wdListNumberStyleArabic, wdListNumberStyleArabic, wdListNumberStyleArabic, _ 
      wdListNumberStyleLowercaseLetter, wdListNumberStyleLowercaseRoman) 
    .NumberPosition = 0 
    .Alignment = wdListLevelAlignLeft 
    .TextPosition = InchesToPoints(j) 
    .TabPosition = InchesToPoints(j) 
    .ResetOnHigher = True 
    .StartAt = 1 
    .Font.NameAscii = "Calibri" 'This line sets the number font
    .Font.Size = 17 - i ' This line sets the number point size, at 16pt for the 1st level, then decreasing by 1pt per level
    .Font.Bold = True 'This line makes the number bold
    .LinkedStyle = "ListNum " & i 
  End With 
  j = j + 0.25 
Next 
End Sub
I've separated the code into two macros so you can experiment with the numbering scheme configuration until you get you preferred setup.

You can create other Styles, too, just by changing the 'ListNum' references in both macros to whatever other Style names you'd like to use.
Paul Edstein
[Fmr MS MVP - Word]

User avatar
Charles Kenyon
5StarLounger
Posts: 677
Joined: 10 Jan 2016, 15:56
Location: Madison, Wisconsin

Re: Save multilevel list with headings

Post by Charles Kenyon »

macropod wrote:
16 Dec 2024, 00:11
You could define and configure multiple multi-level list styles rather than relying only on Word's built-in heading styles.
***
I agree. I did that with one of the [Quick] Style Sets. I will likely add at least two more to the download package.
I think it is especially valuable when porting the numbering into an existing document that already is using the built-in heading styles, unnumbered.

On the other hand, if starting a new document, the built-in heading styles have unique properties that can make it a good idea to use them.
https://www.addbalance.com/usersguide/1 ... Styles.htm

Thank you for sharing your code. I note that it sets five levels, which should be sufficient for any rational use.
Greg Maxey also shared code earlier this year in the Word VBA forum on Office Forums to do this without the indents built into the ones Word ships.
https://www.msofficeforums.com/word-vba ... post181652
It has two version. One creates nine custom styles, the second uses the five built-in List Number styles and creates four custom styles.

User avatar
macropod
4StarLounger
Posts: 524
Joined: 17 Dec 2010, 03:14

Re: Save multilevel list with headings

Post by macropod »

Thank you for sharing your code. I note that it sets five levels, which should be sufficient for any rational use.
Yes, and it can easily be modified to provide up to nine levels.
Paul Edstein
[Fmr MS MVP - Word]

User avatar
Charles Kenyon
5StarLounger
Posts: 677
Joined: 10 Jan 2016, 15:56
Location: Madison, Wisconsin

Re: Save multilevel list with headings

Post by Charles Kenyon »

Even more on numbering - I set my forum diatribe down in a pdf for a presentation I had to give this month.
https://www.addbalance.com/usersguide/A ... bering.pdf