Examining Styles and Macros in a Template

by Allen Wyatt
(last updated December 5, 2017)

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.)

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

Identifying Values that Don't Follow a Specific Pattern

When you store textual information in a worksheet, it can be helpful to figure out if that information follows a pattern that ...

Discover More

Sorting a Text Selection

Word gives you the option to sort selected groups of text. You can do text, date or number sorts on whole paragraphs or ...

Discover More

Pulling a Phone Number with a Known First and Last Name

When using an Excel worksheet to store data (such as names and phone numbers), you may need a way to easily look up a phone ...

Discover More

Do More in Less Time! Are you ready to harness the full power of Word 2013 to create professional documents? In this comprehensive guide you'll learn the skills and techniques for efficiently building the documents you need for your professional and your personal life. Check out Word 2013 In Depth today!

More WordTips (ribbon)

Working on Shared Templates

In many companies it is common to have standard templates accessible through the internal network. If you have templates ...

Discover More

Creating a Letterhead Template

Word is often used to write all sorts of letters. You may want to create a template that makes creating your letters easier ...

Discover More

Determining the Template Attached to a Document

If you've opened a document in Word, that document has a template attached to it. This tip looks at what those templates do ...

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 6 - 0?

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.