Resting Anchor

The Anchorage

Personal website of Gregory K. Maxey, Commander USN (Retired)

Building Blocks & AutoText
(A Microsoft Word Help & Tip page by Gregory K. Maxey)

DISCLAIMER/TERMS OF USE

The information, illustrations and code contained in my "Microsoft Word Tips" are provided free and without risk or obligation.

Click to acces PayPal Verification Service Click to acces PayPal Verification Service

However, the work is mine. If you use it for commercial purposes or benefit from my efforts through income earned or time saved then a donation, however small, will help to ensure the continued availability of this resource.

If you would like to donate, please use the appropriate donate button to access PayPal. Thank you!


In this Microsoft Word Tips & Microsoft Word Help page I will discuss the new building blocks components introduced in Word 2007 and provide a few tools for enhancing their use.  Additional, I will address some enhancements/changes to building blocks in Word 2010 and 2013.

Introduction to Building Blocks

Employing a collection of document parts to create professional looking documents is even easier with Word 2007 - 2013. I use the term "document parts" to describe the collection of document properties, fields, and AutoText that existed in previous Word versions along with the new building blocks.

The focus of this article is on managing these new building blocks and their relationship to the AutoText feature found in previous editions of Word. For more on employing AutoText as a stand-alone feature in previous Word versions, see the MVP FAQ articles: AutoText & AutoTextList.

Building blocks are very similar to AutoText. In the first article link above AutoText is defined as:

"AutoText is a way to store parts of a Word document for re-use. You can, for example, create a library of boilerplate paragraphs for business letters, or keep a handy selection of headers and footers. An AutoText entry can store anything a Word document can contain, such as formatted text, pictures, and fields. Word comes with a number of predefined AutoText entries, and you can add as many as you like."

The definition of AutoText provided above works equally well for building blocks. The key difference is that there is a much larger and richer collection of pre-defined building blocks installed with Word right out of the box!! This collection is comprised of 35 building block types (or galleries). Each gallery can be subdivided into custom categories containing multiple building block entries. Of the 35 building block types, 15 are built-in and 20 are custom types. Despite that distinction, you are able to customize and define your own custom building block entries in any one or all of the 35 galleries.

Most of the built-in building block galleries are accessed and employed using a gallery control or a combination of menu/gallery controls on the Ribbon interface. Table 1 below defines the 15 built-in building block types and shows how the associated galleries are accessed using the Ribbon interface. These dispersed galleries display a collection of defined building blocks as either a partial or full page preview. You simply select and insert the building block at the insertion point from the gallery or right-click the building block in the gallery and select a location to insert the building block. The type of preview display for each gallery is also shown.

 Built-In Building Blocks
NameRibbon InterfacePreview
Quick PartsInsert>Quick PartsPartial
Cover PagesInset>Pages>Cover PagesFull
EquationsInsert>Symbols>EquationsPartial
HeadersInsert Header & Footer>HeaderPartial
FootersInsert>Header & Footer>FooterPartial
Page Numbers (TOP)Insert>Header & Footer>Page Number>Top of Page Partial
Page Numbers (BOP)Insert>Header & Footer>Page Number>Bottom of PagePartial
Page Number MarginsInsert>Header & Footer>Page Number>Page MarginsPartial
Page NumbersInsert>Header & Footer>Page Number>Current Position Partial
Tables Insert>Tables>Quick TablesPartial
WatermarksPage Layout>Page Background>WatermarkFull
AutoTextInsert>Quick Parts>AutoText (Word 2010 only) (**)Partial
Text BoxesInsert>Text>Text BoxFull
Table of ContentsReferences>Table of Contents>Table of ContentsPartial
BibliographyReferences>Citations & Bibliography>Bibliography Partial

Table 1

Site Note IconNote: Contrary to some belief, AutoText did not die with the introduction of Word 2007. As shown in Table 1, AutoText has simply been incorporated as one of the building block types. Microsoft developers, however, failed to include an AutoText gallery in the Word 2007 Ribbon interface. I will address this oversight later.

Other methods for accessing and employing building blocks include the Building Blocks Organizer, the AutoText gallery control, the 20 custom building block type gallery controls, Building Block Content Controls, keyboard shortcuts F3 and ALT+F3, and—not to be left out—AutoText and AutoTextList fields.

Building Block Organizer

The Building Blocks Organizer (shown below) is opened using Insert>Quick Parts>Building Blocks Organizer. The organizer provides a comprehensive list of all of the building blocks contained in each template in the current template collection. With the organizer you can see the building block name, gallery (or type), category, template storage location, behavior, and description. You can use the organizer to modify, insert, or delete individual building block entries. Some shortcomings of the organizer are that the full page preview makes it difficult to distinguish the content of some building blocks, there is an inability to select and delete multiple building blocks, and most disappointing, there is a complete absence of a building block copy feature. I will address these shortcomings as this article progresses.

Site Note IconNote: This tips page was originally developed using Word 2007. You may notice minor differences between your actual installation and the illustrations used here.

bb_at 1

Site Note IconNotes:
     1. The predefined built-in building blocks entries that ship with Word are stored in a template named Building Blocks.dotx (Word 2007) or Built-in Building Blocks.dotx (Word 2010-2013). The template is located in an application installation folder created when you installed Word.  For example, my Word 2007 template is located at C:\Program Files (x86) \Microsoft Office\Office12\Document Parts\1033 (where 1033 is a localID number representing the local language {1003 representing U.S. English}). This is the original distribution template and should not be modified.

     2. During installation of the application, a parallel folder containing the working Building Blocks templates is created in the user application folder ending with: ...\Microsoft Office\Document Building Blocks. For example, my Word 2007 working Building Blocks templates are located at C:\User\Maxey\AppData\Roaming\Microsoft Office\Document Building Blocks\1033.  My Word 2010 working Building Block Templates are located at: C:\User\Maxey\AppData\Roaming\Microsoft Office\Document Building Blocks\1033\14.  The exact location of your working Building Blocks templates will be determined by your operating system, user name, and installation path.

     3. An easy way to get in the ballpark though, is to open Windows Explorer (the My Computer icon on the desktop). In the Address box near the top, paste or type in:
%appdata%\microsoft and press enter.  That will go to the right application folder in any version of Windows, no matter what your user name is, and no matter whether you've selected the option to show hidden folders.
 
     4. In Word 2007, the working Building Blocks template is the default "Save in" template whenever you attempt to create a new building block.  In Word 2010/2013, the Normal.dotm template is the default "Save in" template when you invoke the "Create New Building Block" dialog by pressing Alt+F3.  However, if you invoke the dialog by selecting one of the "Save Selection to XXXX Gallery" (where XXXX is a named gallery) controls, the default template is the Building Blocks.dotm.

     5. The working building block templates are not loaded until you attempt to access your building blocks by clicking on a gallery control or the organizer. This accounts for the initial short delay displaying building blocks on first use in a Word session.

     6. Sometimes the working template can become corrupted. When this happens, you can rename (or delete) the working template and then close and restart Word. When Word restarts, a new working template is created from the original distribution template.  If you rename the working template (e.g., buildingblocksold.dotx) then you may use the tools described in this page to possibly recover any custom building blocks you have created and stored in it.

     7. If you do an in-place upgrade from Word 2003 to Word 2007/2010/2013, the installer for Word 2007/2010/2013 renames your Normal.dot template to something like Normal11.dot. If you store that  renamed template or any template containing an AutoText or Building Block collection into the parallel folder described above, the AutoText/Building Block entries stored in that template will be loaded at the same time as the Building Blocks template entries are loaded.  This can be handy when you need short-term access to a large collection of AutoText/Building Blocks.  When they are no longer needed, you can relocate the template to another folder.

    8.  With dual Word installations, I have found that Word 2010 has trouble detecting additional templates placed with the working built-in templates in the ...\1033\14 folder.  Placing the additional templates directly in the ...\Document Building Blocks folder works well.

    9.  Microsoft has finally provided a bit of clarification on these issues as well as a few other tips for employing AutoText here:  Add AutoText in Word 

AutoText Gallery Control

The AutoText gallery control, like the other 14 built-in building block gallery controls, provides a preview and access to all of the building block entries defined as type "AutoText." As mentioned above, the developers at Microsoft did not include this control on the Word 2007 ribbon. You can add it to your Quick Access Toolbar (QAT) by right-clicking the QAT and selecting "Customize Quick Access Toolbar." When the customization dialog appears, select "All Commands," then in the "Choose commands from" dropdown, scroll down and select "AutoText," then click on "Add." Customize Quick Access Toolbar "For all documents (default)" or in the appropriate template. The AutoText gallery can also be added to the ribbon using ribbon customization methods, but more on that later.

bb_at 2

Site Note IconNote: Microsoft has simplified user access to the built-in AutoText gallery in Word 2010 by adding the control to the Insert>Quick Parts menu.

Custom Building Block Galleries

The 20 custom building block types are shown in Table-2 below. As you can see in the table, there is a custom gallery corresponding to each built-in gallery plus five additional custom galleries. Like the AutoText gallery, all of the 20 custom galleries can be added to the QAT or ribbon.

 Custom Building Block Galleries
Custom Quick Parts 
Custom Cover Pages 
Custom Equations 
Custom Headers 
Custom Footers 
Custom Page Number (Top of Page) 
Custom Page Number (Bottom of Page) 
Custom Page Number (Page Margin) 
Custom Page Number (Current Position) 
Custom Tables 
Custom Watermarks 
Custom AutoText 
Custom Text Boxes 
Custom Table of Contents 
Custom Bibliography 
Custom Gallery 1 
Custom Gallery 2 
Custom Gallery 3 
Custom Gallery 4 
Custom Gallery 5 

Table 2

The 35 building block types or galleries simply provide enhanced organization and grouping of the built-in and your custom-defined building blocks. The galleries are yours to do with what you wish. You could create a new building block and store it in any one of the 35 galleries. For example, you could create a group of building blocks consisting of some of your favorite images in a "Favorite Pictures" category of the custom Text Box gallery. By doing this you would take advantage of the Text Box gallery full page preview.  I realize that your favorite pictures aren't really textboxes; but hey it is your program, so use it how you like.

Creating New Building Blocks

Like AutoText in previous Word versions, building blocks are defined and created based on a selection in the document. As the definition provided above states, this can be anything a Word document can contain, such as formatted text, pictures, and fields.

ALT+F3 is still the keyboard shortcut used to create a new building block. When you select an item (block of text, image, etc.) and press ALT+F3, a Create New Building Block dialog is presented, as shown below.

bb_at 3

Word 2007 Default dialog

bb_at_3A

Word 2010/2013 default

The values initially displayed  in the dialogs are always the same, but are defined by the  version of Word you are using.ed by the selected text," "Type: Quick Parts," "Category: General," and "Save in: Building Blocks.dotx.

With either dialog, you can use the default values or change the values to create the new building block in any one of the 35 galleries, assign a custom name, choose from an existing category or create a new category, or define a different template storage location.

An alternative method for creating a new building block is using the "Save Selection to XXXX Gallery" command that appears at the bottom of each of the built-in gallery menu controls (where XXXX is the gallery name). Using these controls display the Create New Building Block dialog similar to using ALT+F3.  This difference being that the Type initially displayed will match the Type of the gallery control used and the Save-in location in most all cases (except the AutoText gallery control in Word 2010/2103) will be Building Blocks.dotx.  Again, since you can change the values in the dialog, you can use any one of these controls to create and define a building block in any of the 35 galleries.

bb_at_4

bb_at_3B
Dialog presented in Word 2010 after selecting "Save Selection to Text Box Gallery"

You can also create a new building block programmatically using VBA by defining the storage template, name, type, category, and range using code similar to that shown below.

VBA Script:
Sub AddBBProgramatically()
Dim oRng As Word.Range
Dim oTmp As Template
  Set oRng = Selection.Range
  sPath = Options.DefaultFilePath(wdUserTemplatesPath) & "\Normal.dotm"
  Set oTmp = Templates(sPath)
  oTmp.BuildingBlockEntries.Add _
  Name:="New BB", Type:=wdTypeQuickParts, Category:="New Category", Range:=oRng
lbl_Exit
Exit Sub
End Sub

Site Note IconNotes:
     1. The procedure above stores the building block created in the Normal.dotm template.  You can change the path and template as appropriate to your needs.

     2. The parameter "Type" assigns the gallery type similar to "Gallery" field in the "Create New Building Block" dialog.
 
     3. See: Installing Macros for instructions on how to set up and use the macros provided in this Microsoft Word Help & Microsoft Word Tips page.

     4.  See: Build & Employ Custom Building Block Gallery for a fully automated building block generating tool.

The building blocks I create don't aren't saved or are missing the next time I start Word!!

If the building block entries you create in one session of Word are not available when you close and restart Word, then the possibility exists that your target template is not being saved properly.  This could be due to damage/corruption of the file itself or incorrect permissions on the template folder (for the Normal.dotm template this folder is normally %appdata%\Microsoft\Templates).  After you create an entry and close Word, go to the template's storage folder and check the templates "Modified date/time" to see if it updated.

Entering building blocks into your document

In addition to the methods previously discussed, there are several other methods you can use to enter a building block in your document:

Building Block Organizer

You can select and insert a building block using the organizer.

Blocking Block Auto insert using F3

You can insert a building block after typing part of the building block name and then pressing F3.

Site Note IconNote: You have to type just enough characters to distinguish the building block from all other building blocks, otherwise Word displays an alert in the status bar, "The specified text is not a unique building block name. Provide a unique name."

Show AutoComplete Suggestions

To the great dismay of many, the handy "Show AutoComplete suggestions" feature available with AutoText in previous Word versions is not available in Word 2007.

Fortunately, this feature was restored, to a point, with Word 2010 and even further in Word 2013. To activate this feature use File>Options>Advanced>Editing Options>Show AutoComplete Suggestions.

bb_at 5

While unwilling to forgive Microsoft for the omission of Show AutoComplete Suggestions in Word 2007, moving from a single AutoText object to thirty-five building-block galleries with an unlimited number of categories understandably "muddied the water" so to speak.  I can imagine the challenge and appreciate the technical effort that it took to get it restored to the point that it is. 

To have success with the Show AutoComplete Suggestions feature in Word 2010, one of the following two conditions must be met:

Show AutoComplete Suggestions will not be displayed if your building block entries are defined and saved in building block.dotx or any other template location.

Unlike the F3 key auto entry method where a single unique first character is sufficient to make the auto entry, you must type at least the first four characters of the building block name and enough characters to be unique before Show AutoComplete Suggestions is displayed.   

In Word 2013 building block entries stored in other templates which are loaded as add-ins will also trigger the AutoComplete suggestion prompt.  Building Blocks stored in the dedicated Build Blocks.dotx file still do not trigger AutoComplete Sugestions.

Site Note IconNote: As mentioned previously, the ability to define building blocks in multiple galleries, categories, and templates has dramatically complicated Word's "under the hood" process of determining which building block entry to insert when you attempt to use either the F3 key or ShowAutoComplete Suggestions method.  The difficulty is exacerbated if you have defined two or more liked-named building blocks in two or more different galleries or templates and the behavior you see when you try to use either F3 or Show AutoComplete Suggestions can be perplexing.
   
    1. If you define building blocks using the same name in two different galleries, the F3 auto insert method will not recognize or insert a building block unless one of the galleries used is the Quick Part (AutoText if using Word 2010) gallery. In that case the F3 key (and Show AutoComplete suggestions in Word 2010) will recognize and enter the building block as defined in the Quick Part (AutoText if using Word 2010) gallery.

    2.  Similarly, using like-named building blocks in two or more templates (e.g., the active document template, the normal template, or the building blocks template) may be confusing. The general hierarchy is document template, normal template, and built-in template.

Building Block type content control

You can insert a building block type content control. Using the Developer Tab>Controls group, select "Building Block Gallery." This automatically inserts a content control that contains all of the building blocks in the Quick Part gallery.  Once inserted, you can use the Content Control properties dialog to define the gallery and category displayed.

bb_at 6

bb_at 7

bb at 8
bb  at 9
bb aa 10
VBA Script:
Sub EnterBBProgramatically()
Dim oRng As Word.Range
Dim oTmp As Template
Dim sPath as String
  Set oRng = Selection.Range
  sPath = Options.DefaultFilePath(wdUserTemplatesPath) & "\Normal.dotm"
  Set oTmp = Templates(sPath)
  oTmp.BuildingBlockTypes(wdTypeQuickParts).Categories("General") _
    .BuildingBlocks("MyBuildingBlock").Insert Selection.Range
lbl_Exit:
Exit Sub
End Sub

Site Note IconThe code assumes, of course, that you have a "General" category defined in the Quick Part gallery of your Normal.dotm template containing a building block named "MyBuildingBlock.

Deleting building blocks from templates and galleries

You can delete a building block entering from any template in the current template collection using the organizer. The organizer is accessed from the Insert>Quick Parts ribbon control or from right-clicking a building block preview in a gallery and selecting "Organize and delete."

VBA Script:
Sub DeleteBBProgramatically()
Dim oTmp As Template, sPath as String
  sPath = Options.DefaultFilePath(wdUserTemplatesPath) & "\Normal.dotm"
  Set oTmp = Templates(sPath)
  oTmp.BuildingBlockTypes(wdTypeQuickParts).Categories("New Category").BuildingBlocks("New BB").Delete
lbl_Exit:
Exit Sub
End Sub

Shortcomings and Enhancements

Now that you are familiar with what building blocks are and how to create and employ them I am going to shift focus and address some of the shortcomings in the built-in ribbon interface and building block organizer.

My solution to these shortcomings is in the form of a Word template add-in that you install and load from the Word startup directory. This add-in provides RibbonX customization of the ribbon that modifies existing controls and adds several additional controls to the ribbon. This will give you more control over creating, accessing, and organizing your building blocks collection.

As shown in the following illustration, I have made a few subtle, top-level changes to the Insert tab>Text group. I renamed the group "Document Parts & Text" and reordered and changed "Quick Parts" to "Document Parts." In my opinion, "Quick Parts" is a poor label as the collection of Document Properties, Fields, and Building Blocks are more properly classified as "Document Parts."

bb at 11

As illustrated below, the new Document Parts control consists of a custom menu control that includes the built-in Quick Parts control (relabeled Quick Parts Gallery & Tools); the built-in Document Property, Field and AutoText Gallery controls, a custom menu control containing controls for each of the 20 custom galleries, the built-in Building Blocks Organizer control, a custom button control to initiate Organizer Enhanced Tools, a custom menu control containing three custom button controls used for loading building blocks from an external Word table, a custom button control for initiating the Document Variables custom dialog, and the built-in Get More from Office online control.

bb at 12

Site Note IconNotes:
      1. There are some unavoidable redundancies in the modified user interface as the Quick Part Gallery control is unique in that, in addition to displaying the preview of Quick Parts building blocks and "Save Selection to Quick Part Gallery" control, it displays a collection of other tools (e.g., Document Property, Field, etc.).

     2. I wanted to move the Quick Parts preview off the Document Parts menu since the preview can push these additional commands to the bottom of the screen and then re-create the other tools directly on the new Document Parts menu.

     3. Since "QuickPartsInsertGallery" is a built-in control its content cannot be edited, this results in the other tools being displayed both on the Document Parts menu (as intended) and on the "QuickPartsInsertGallery" control (the redundancy).

bb at 13

The AutoText control displays the AutoText preview gallery. The Custom Galleries control displays a menu of the 20 custom galleries.

bb at 14

The Organizer Enhanced Tools button control displays a Userform interface providing functions to copy, delete, or insert individual or multiple building blocks from the selected source template.

bb at 15

Site Note IconNote: Much to my dismay, I have learned the copy building block process only works for text and graphic building blocks.  It does not faithfully reproduce building blocks that involve page layout (e.g., cover pages or watermarks).  If I find a solution, I'll post it. Sorry.

The Building Block Loader menu control displays three button controls that provide an interface for creating and managing a group of building blocks that you can define using "Entry Tables."  A description of this function is provided below:

bb at 16
Building Block Loader menu controls

Edit Entry Tables - The add-in contain four sample tables used for creating groups of building blocks.  When you click this button, the template add-in opens.  With the add-in file open, you can modify the existing tables, delete the tables, or add additional tables.  The table layout for your building block group must have a single column heading row to define the "category," and two column rows for each entry. The first column defines the building block image or text and the second column defines the building block name.  One of the sample tables is illustrated below.   

bb at 16A

Load/Refresh Building Blocks:

bb at 17

This scenario loads a group of building blocks from an external table titled "Salutations"
 into a category "Salutations" in the Custom AutoText gallery of the Normal.dotm template.

Delete building blocks:

bb at 18
This scenario would delete all building blocks defined in the "Filler Text"
category of the Quick Part gallery in the template workdocuments.dotm

The Document Variables control displays a custom dialog for managing and working with document variables. Using this dialog, you can see a list of any variables assigned in the document and review its value. The dialog can also be used to create, insert, or delete document variables.

bb at 19

And finally, the last feature in the add-in is the "Building Block QuickPick" dialog.

With this dialog you can quickly drill down and select the correct Building Block to insert in a document. You can initiate the dialog using the keyboard shortcut CTRL+q,p, from the "QuickPick" command added to the Quick Access Toolbar (QAT), or from a control added to the "Text" shortcut menu shown below. When initiated, the dialog is presented at or near the IP/selection.

bb at 23

bb at 20


bb at 21

bb at 22

Site Note IconNote: The template add-in contains two VBA procedures that you can use to add or remove the shortcut menu "QuickPick" command.

This concludes this Microsoft Word Help & Microsoft Word Tips page. I hope that it gives you a better understanding of building blocks in Word 2007 and that you enjoy using the tools to enhance their use. You can download the template add-in here:  Building Block Enhanced Tools.

Site Note IconFor more on template add-ins and how to load them, see the heading "Organizing Global Templates" at: Organizing Your Macros.

Share Stumbleupon

PAYMENTS/DONATIONS

Click to acces PayPal Verification Service Click to acces PayPal Verification Service

Do you want to make a payment for consulting work or donate to help support this site?

PayPal is a safe, easy way to pay online.

Use the appropriate currency "Donate" button to make a payment or donation.


Search my site or the web using Google Search Engine

Google Search Logo

Or

JustAnswerAsk a Word Expert OnlineSubmit