View Single Post
 
Old 02-25-2023, 09:50 AM
spillerbd spillerbd is offline Windows 10 Office 2021
Competent Performer
 
Join Date: Jan 2016
Posts: 130
spillerbd is on a distinguished road
Default

After much testing... Microsoft® Word for Microsoft 365 MSO (Version 2301 Build 16.0.16026.20196) 64-bit
The StylesSet is composed of the Styles set to Show in the Style Gallery AND are saved as a Template file type in
C:\Users\%userName%\AppData\Roaming\Microsoft\Quic kStyles.

The last part of Styles being Saved in the document can be seen by examining the list shown through the Manage Styles, Import/Export option.
If starting from the Normal.dotm, there are essentially no styles in the Template. Any StyleSet created from a freshly started "Blank" document is very much that, Blank, including Styles! All the styles we see are the Applications Built In styles and they will not be saved into the documents XML until Modified or Used. A Unused and unmodify style can be set to be displayed in the Gallery, but will not be saved as part of the StyesSet because their is no Style in the document to copy!

It does appear that MS may have expected users to select an appropriate StylesSet from their list. Doing so will add the remaining list to get to the 26* "standard" Styles. (The TOC Heading style is missed in Charles Kenyon Style Sampler.)
Using the Normal.dotm StylesSet will only update the 3 styles as Default Paragraph Font style is only a reference.
Also, just adding a Style to the Gallery is insufficient. The Style must also be used or modified for Word to see it as different from the Application's built in style and save it to the Docuemnt for reference and copying.

This means that creating a Template from which StyleSets may be created from may require a lot more awareness than one may think.

A Robust Template will define all the Built In Styles and not rely on the Application to provide them. Also, if a Style is not Saved in the document, the Style will not revert back to the "default" builtin characteristics.
To add the Styles to the document, one needs to use or modify all the desired styles.
For a macro that does this see, https://www.msofficeforums.com/word-...tml#post173769 Thanks Andrew!
Modifying the macro to comment out the wdStyleTypeTable is likely appropriate for most users.

For most users, is using and therefore defining all builtin styles in the document necessary? No.
For what he OP wishes to accomplish, I believe it is.
Essentially it is the same as doing a VBA code without Explicit turned on. Each Style in the Template must be explicitly defined to ensure that if a style is used in a StylesSet it adots the new settings.

I would also say that a Robust Company Template would also explicitly define all the Built-In Styles in templates and even use the Restrict Editing feature to keep users from using Direct Formatting.

During my research, I found this Blog post. Overall, nothing new, but sometimes a different writing allows a new perspective. Changing your style in the new Word | Microsoft 365 Blog
Reply With Quote