Forum Discussion
List Styles & Style Sets
Does anyone know if it is possible to include a list style within a style set? I know to add the styles I want to include in a style set into the style gallery, then save the style set under the design tab. However, even though the styles in my style set are linked to list styles for the numbering, those list styles do not get transferred to a document I add the style set to. I really need the list styles to also transfer to the document I'm adding the style set to. Of course, list styles do not show up in the styles pane or the style gallery (or at least I cannot determine how to get them to). Thoughts?
So long as the list style can be transferred using the Organizer, you should be able to do this with a macro. A Global StyleSheet in Microsoft Word? [Quick] Style Sets do not require macros, though, and may work for you if each level is attached to a unique paragraph style and all of the styles are in the set. A drawback to [Quick] Style Sets is that they usually include styles that are not relevant to the numbering scheme. You also have to be careful that none of the numbered styles are based on styles not in the set.
Were your list styles set up following Shauna Kelly's methods? Mine were, and the transfer through using the [Quick] Style Sets has worked without any problems. There have not been large scale tests but I've been giving that advice for many years without having anyone tell me that I'm wrong. Take a look at my sample [Quick] Style Sets. Try them. If they do not reliably pass on the numbering scheme please let me know.
List Styles do show up in the Apply Styles dialog and in the drop-down Style List.
If you simply import the styles (not using a set but using the Organizer) it is vital that you import all related styles and that you do so three times.
I do not work for MS. The problems with automatic numbering have persisted since Word 97, at least. They were laid out by John McGhie (Word Numbering Explained by John McGhie, MVP) and Shauna Kelly gave us step by step instructions for getting past them. Neither List Styles nor Table Styles can be part of a Quick Style Set. Both can be manipulated in the Organizer. I do not expect Word to change how it works.
10 Replies
- Charles_KenyonBronze Contributor
Since you already have such code, this is more for others who may stumble across this question. Here is revised code from my Add-In.
Sub OutlineStyleCopy1() ' ' StyleCopy Macro written by Charles Kyle Kenyon 14 November 2001, revised 12 March 2017, revised April 2026 ' ' Copies all Built-In Heading Styles and the List Style using them to the current document ' If the numbering is attached to styles other than the Built-In Headings, the style names need to be set below ' Copyright 2001, 2017, 2026 All rights reserved ' Copies styles from stylesheet global template to active document ' keyboard shortcut Ctrl+Shift+Alt+3 ' Thank you to Hans Vogel for the assistance with the workaround needed for a false alert about changes to the attached template ' (often the normal template) ' This is set to copy a numbering list style "Headings" and associated paragraph styles using the Organizer Method ' This method could be used to create a StyleSheet to transfer non-numbered styles (like the BodyStyleCopy1 procedure)but ' in Word 2007 and later the [Quick] Style Sets do this very nicely. A List Style, though, can not be part of such a set. ' ' Updated to declare and use variable names for the Styles being copied to make for easier changes. ' As set, this uses the built-in heading styles associated with a List style. ' The headings can have different local names, which are associated with a .NameLocal. ' If using other paragraph level styles, the styles must exist in this Add-In template before running the macro. ' If a List Style is involved, it must be set up using the procedures shown in Shauna Kelly's page. The variable ' sListStyle must be changed if using a different List Style. ' If not transfering a List Style, comment out the last Organizer line dealing with a List Style. ' Dim sThisTemplate As String, sTargetDoc As String, sListStyle As String Dim sStyle1 As String, sStyle2 As String, sStyle3 As String, sStyle4 As String, sStyle5 As String ' Style Names Dim sStyle6 As String, sStyle7 As String, sStyle8 As String, sStyle9 As String ' Style Names Dim i As Integer ' Counter 1 - use for copying styles three times Dim iCount As Integer ' Counter 2 - use to loop copying of heading styles Dim rResponse As Variant ' can be vbMsgBoxResult in Word 2000 or later Dim bSaved As Boolean ' Hans Vogel ' Let bSaved = ActiveDocument.AttachedTemplate.Saved ' Let sListStyle = "Headings" ' change if List Style is different name ' ' ASSIGN Names for styles attached to List - must be exact! ' The ones below give the names for the Built-In Heading Styles Let sStyle1 = ThisDocument.Styles(wdStyleHeading1).NameLocal Let sStyle2 = ThisDocument.Styles(wdStyleHeading2).NameLocal Let sStyle3 = ThisDocument.Styles(wdStyleHeading3).NameLocal Let sStyle4 = ThisDocument.Styles(wdStyleHeading4).NameLocal Let sStyle5 = ThisDocument.Styles(wdStyleHeading5).NameLocal Let sStyle6 = ThisDocument.Styles(wdStyleHeading6).NameLocal Let sStyle7 = ThisDocument.Styles(wdStyleHeading7).NameLocal Let sStyle8 = ThisDocument.Styles(wdStyleHeading8).NameLocal Let sStyle9 = ThisDocument.Styles(wdStyleHeading9).NameLocal ' Error Handler set On Error GoTo NoDocument ' Call when no document is open. ' Define This Template and Target Document variables sThisTemplate = ThisDocument.FullName ' name and path of global template sTargetDoc = ActiveDocument.FullName 'generates error if no document open ' If any other errors, continue on On Error Resume Next rResponse = MsgBox(Prompt:="This command redefines your " _ & vbCrLf & "Heading Styles 1-9. Are you sure you want to do this?" _ & vbCrLf & vbCrLf & "If you are not sure, answer 'No' and make a backup of your document." _ & vbCrLf & "Then run the command to copy the styles again.", _ Title:="Are you sure you want to redefine your styles?", _ Buttons:=vbYesNo + vbExclamation) If rResponse = vbNo Then Exit Sub ' Copy Heading Styles to Active Document and Headings List Style For i = 1 To 3 With Application ' Changed to use Word constants to make language independent ' .OrganizerCopy Source:=sThisTemplate, _ ' Destination:=sTargetDoc, Name:=ThisDocument.Styles("Headings").NameLocal, _ ' Object:=wdOrganizerObjectStyles ' Headings List Style .OrganizerCopy Source:=sThisTemplate, _ Destination:=sTargetDoc, Name:=sStyle1, Object:=wdOrganizerObjectStyles ' Level 1 Style .OrganizerCopy Source:=sThisTemplate, _ Destination:=sTargetDoc, Name:=sStyle2, Object:=wdOrganizerObjectStyles ' Level 2 Style .OrganizerCopy Source:=sThisTemplate, _ Destination:=sTargetDoc, Name:=sStyle3, Object:=wdOrganizerObjectStyles ' Level 3 Style .OrganizerCopy Source:=sThisTemplate, _ Destination:=sTargetDoc, Name:=sStyle4, Object:=wdOrganizerObjectStyles ' Level 4 Style .OrganizerCopy Source:=sThisTemplate, _ Destination:=sTargetDoc, Name:=sStyle5, Object:=wdOrganizerObjectStyles ' Level 5 Style .OrganizerCopy Source:=sThisTemplate, _ Destination:=sTargetDoc, Name:=sStyle6, Object:=wdOrganizerObjectStyles ' Level 6 Style .OrganizerCopy Source:=sThisTemplate, _ Destination:=sTargetDoc, Name:=sStyle7, Object:=wdOrganizerObjectStyles ' Level 7 Style .OrganizerCopy Source:=sThisTemplate, _ Destination:=sTargetDoc, Name:=sStyle8, Object:=wdOrganizerObjectStyles ' Level 8 Style .OrganizerCopy Source:=sThisTemplate, _ Destination:=sTargetDoc, Name:=sStyle9, Object:=wdOrganizerObjectStyles ' Level 9 Style .OrganizerCopy Source:=sThisTemplate, _ Destination:=sTargetDoc, Name:=sListStyle, Object:=wdOrganizerObjectStyles ' ListStyle End With Next i rResponse = MsgBox(Prompt:="Do you also want to copy the accompanying Body Text Styles?", _ Buttons:=vbYesNo, Title:="Body Text) Styles Too?") If rResponse = vbNo Then Exit Sub Call BodyStyleCopy1 Exit Sub ' Skip error handler routine NoDocument: ' Error Handler - Will be called if there is not an open document MsgBox Prompt:="Sorry, this command is only available when you have a document open.", _ Title:="No document open!", Buttons:=vbExclamation End SubIt copies a List Style set in the template with the associated paragraph styles. While I believe that the [Quick] Style sets can reliably transfer numbering, they do not transfer the list style, while this macro does. This mimics what happens if you use the Organizer to copy a list style. When you do that, Word asks before copying each of the associated paragraph styles. In the macro, you are asked once.
For your purposes, it has surplus at the end about the Body Text styles. The Add-In has a Body Text style available for a following style for each of the Heading Styles. The code for adding those is a separate procedure in the Add-In. You could delete that from the macro, just answer "No," or create the Body Text styles. If you create the Body Text Styles, you would need that macro as well.
This will be on my downloads page in a few days. I added substantial commenting and set it so the Style names are set as variables at the beginning of the macro.
- jamesright22Copper Contributor
List styles usually don’t get saved with a style set, so they won’t move to a new document.
You may need to create or copy the list styles again in the new document manually.
- Charles_KenyonBronze Contributor
See: [Quick] Style Sets can include multilevel numbering attached to styles.
List styles cannot be a part of a [Quick] Style Set. You can use a set to transfer the numbering scheme, though, which can be edited. The numbering needs to be attached to discrete paragraph styles which have to be in the set.
- Automatic Numbering in Word - my 5-page pdf
- Quick Style Sets and Themes in Microsoft Word
- [Quick] Style Sets with MultiLevel Numbering attached to paragraph styles (There is a zip folder containing 100+ [Quick] Style Sets with numbering and a ReadMe document.)
It is also possible to set up a macro that uses the Organizer method, but your client would have to install the template as an Add-In and allow macros to run. A Global StyleSheet in Microsoft Word?
- bkhenleyCopper Contributor
That's unfortunate. I always use List Styles for numbering rather than just defining a new multi-level list. My experience has been that if I import a List Style from one document to another, the numbering scheme comes over intact 100% of the time (along with all of the other styles I've linked to each level of numbering). If I just define a new multilevel list and import the styles linked to said list, the numbering doesn't always come across correctly into the document I'm editing. As such, I view List styles as a superior method for automatic numbering. I just don't understand why Microsoft doesn't make list styles visible in the styles pane and includable in a style set. Add that to the absurdly long list of things Microsoft could do to improve Word's usability...
- Charles_KenyonBronze Contributor
So long as the list style can be transferred using the Organizer, you should be able to do this with a macro. A Global StyleSheet in Microsoft Word? [Quick] Style Sets do not require macros, though, and may work for you if each level is attached to a unique paragraph style and all of the styles are in the set. A drawback to [Quick] Style Sets is that they usually include styles that are not relevant to the numbering scheme. You also have to be careful that none of the numbered styles are based on styles not in the set.
Were your list styles set up following Shauna Kelly's methods? Mine were, and the transfer through using the [Quick] Style Sets has worked without any problems. There have not been large scale tests but I've been giving that advice for many years without having anyone tell me that I'm wrong. Take a look at my sample [Quick] Style Sets. Try them. If they do not reliably pass on the numbering scheme please let me know.
List Styles do show up in the Apply Styles dialog and in the drop-down Style List.
If you simply import the styles (not using a set but using the Organizer) it is vital that you import all related styles and that you do so three times.
I do not work for MS. The problems with automatic numbering have persisted since Word 97, at least. They were laid out by John McGhie (Word Numbering Explained by John McGhie, MVP) and Shauna Kelly gave us step by step instructions for getting past them. Neither List Styles nor Table Styles can be part of a Quick Style Set. Both can be manipulated in the Organizer. I do not expect Word to change how it works.
You may have some luck if you set up your list style so that each level is also associated with a unique paragraph style. Add the paragraph styles to your style set.
Generally, though, my experience is that bullets and numbering are not working consistently with style sets.
As Kidd_Ip suggested, use a document template instead.
- bkhenleyCopper Contributor
Thanks. I can import list styles using the Organizer; and I have written macros that import sets of styles (along with list styles) into whatever document I'm editing (and those work perfectly). When deploying this kind of thing for clients, it would just be a lot easier if I could give them style sets to import; but I need those list styles to be included. I've frankly never understood why list styles cannot be made to show up in the styles pane or the style gallery. Frustrating...
I believe not but using templates (.dotx) or themes rather than relying solely on style sets.
https://support.microsoft.com/en-gb/office/customize-or-create-new-styles-d38d6e47-f6fc-48eb-a607-1eb120dec563
https://www.technipages.com/how-to-access-and-use-style-sets-in-microsoft-word/