Examining Styles and Macros in a Template

by Allen Wyatt
(last updated August 4, 2018)

3

Templates are designed to contain a collection of styles, macros, and other customizations that can be used to help consistently develop a document or series of documents. If you receive a template from someone else (or open one that you created years ago), you may wonder if there is a way to display the details of the styles and macros contained within that template.

There is no built-in way to do this, unfortunately. (It would be very helpful if there were.) Word allows you to see which styles are in a template or, for that matter, in a document relatively easily. All you need to do is load the template and use the Organizer to look at the styles it contains. If you prefer, you could use a macro to list in a new document all the styles in the current one. There are many ways to approach such a task; the following is one written by Jessica Weissman:

Sub describeAllStylesWeCareAbout()
'  by Jessica Weissman

    Dim docActive As Document
    Dim docNew As Document
    Dim styleLoop As Style

    Set docActive = ActiveDocument
    Set docNew = Documents.Add
    For Each styleLoop In docActive.Styles
        If styleLoop.Type < 3 Then
        ' show only character and paragraph styles, not list or table styles
            With docNew.Range
                .InsertAfter Text:=styleLoop.NameLocal & Chr(9) _
                  & styleLoop.Description
                .InsertParagraphAfter
                .InsertParagraphAfter
            End With
        End If
    Next styleLoop
End Sub

The problem with either approach (Organizer or special macro) is that they don't list any modifications to built-in styles that are often so important to design a template effectively. For instance, if the Normal style on a system is normally set to 10-point Arial and that has been changed to 12-point Times New Roman in the template, there is no way with the above solutions to tell that this change has been made; you only know that the template uses the Normal style. (Duh! All templates contain the Normal style.)

When it comes to macros, you need to load the template and simply go look in the Visual Basic Editor. There is where you'll find the macros and be able to try to figure out what they do. (Make sure you use the Project window to look for VBA projects specifically associated with the template.)

Note:

If you would like to know how to use the macros described on this page (or on any other page on the WordTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (12715) applies to Microsoft Word 2007, 2010, 2013, and 2016.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Repeating Rows at the Bottom of a Page

Excel allows you to repeat rows at the top of every page of a printout. If you want to repeat rows at the bottom of every ...

Discover More

Deriving an Absolute Value

Want to know the absolute value of a number? It's easy to derive in VBA by using the Abs function.

Discover More

AutoFormat Won't Convert a Right Arrow

Word can automatically convert different sequences of text characters into single-character symbols. It might appear that ...

Discover More

Learning Made Easy! Quickly teach yourself how to format, publish, and share your content using Word 2013. With Step by Step, you set the pace, building and practicing the skills you need, just when you need them! Check out Microsoft Word 2013 Step by Step today!

More WordTips (ribbon)

Inconsistent Prompting to Save Normal Template Changes

You can configure Word to notify you when it is about to save updates to the Normal template. There may be some ...

Discover More

Saving a Preview with Your Template

Templates provide a collection of styles and boilerplate for new documents. Selecting the right template by filename only ...

Discover More

Understanding Templates

Templates are used to store a pattern for how a document should look. As such, they can be a very powerful tool for ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is three minus 3?

2017-12-05 10:01:14

Tammy Richardson

Examining Styles and Macros in a Template

I have dreamed about a print out of all the styles in a document that would let me see in place what is linked or needs to be modified. This and the acronym finder VBA are my favorite tips of all time. Can't say thank you enough!!!


2015-10-07 06:20:12

Torben

To create the same with the name actually formatted in that style, you can do this:

'=============================================================================================
Sub describeAllStylesWeCareAbout()
' by Jessica Weissman
' http://wordribbon.tips.net/T012715_Examining_Styles_and_Macros_in_a_Template.html

Dim docActive As Document
Dim docNew As Document
Dim styleLoop As Style

Set docActive = ActiveDocument
Set docNew = Documents.Add
For Each styleLoop In docActive.Styles

'wdStyleTypeCharacter 2 Body character style.
'wdStyleTypeList 4 List style.
'wdStyleTypeParagraph 1 Paragraph style.
'wdStyleTypeTable 3 Table style.

If styleLoop.Type = wdStyleTypeParagraph Then
Selection.Style = styleLoop
Selection.TypeText Text:=styleLoop.NameLocal
Selection.TypeParagraph
Selection.Style = ActiveDocument.Styles("Normal")
Selection.Font.size = 9
Selection.TypeText Text:=styleLoop.Description
Selection.TypeParagraph
Selection.TypeParagraph
End If
Next styleLoop
End Sub
'=============================================================================================


2013-11-09 10:50:12

bo vandenberg

How about taking us through the solution you suggest? How do you open the editor and load the template?


This Site

Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.