Examining Styles and Macros in a Template

by Allen Wyatt
(last updated July 9, 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 was.) Word allows you to relatively easily see which styles are in a template or, for that matter, in a document. 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 ot 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 effectively designing a template. 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, and 2013.

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

Jumping between Columns

Need to jump from one column to another on a page? You can use the handy shortcut keys described in this tip.

Discover More

Removing Shading from Many Paragraphs

Need to format a bunch of paragraphs within your document? Word provides some very easy ways to apply the same formatting ...

Discover More

Templates and Page Setup

Templates are a great way to share styles, macros, and other settings among various documents. One thing that isn't ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

More WordTips (ribbon)

Creating a Document Based on a Template

Double-click a Word template file in Windows, and Word should create a brand new document based on that template. If this ...

Discover More

Managing Corporate Templates

Templates are used to store styles and lots of other customizations that affect how you use Word. On a single-user ...

Discover More

Updating Many Template References

Documents rely on templates. If you change the location of those templates (on purpose or by accident), Word can take a ...

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 5 + 2?

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.