Resting Anchor

The Anchorage

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

Build & Deploy Custom Building Block Galleries
(A Microsoft Word Help & Tip page by Gregory K. Maxey)


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 show you a quick and easy way to build and deploy a built-in custom building block gallery from the Ribbon, the Quick Access Toolbar (QAT), or a building block type content control. As is becoming customary, acknowledgement is due friend and Word MVP Graham Mayor. Graham gets credit for dogged development reviews and criticism which has led to many improvements. I also need to acknowledge friend and Word MVP Jay Freedman, as the idea for this add-in was hatched from Jay's AutoTextLoader utility.

Why create and use this add-in? The ribbon Insert>QuickParts>BuildingBlock Organizer sequence has a few shortcomings.

bb gallery 1

Using one of the many built-in custom building block galleries available in Word, you can eliminate the need to search through the building block organizer for your frequently used entries and you have a better preview of your entries. The image below is the same building block AutoText shown above. For this example I used the built-in building block gallery "Custom Gallery 1" deployed on the QAT.

bb gallery 2

In my Ribbon Gallery Control tips page, I showed you how to create a custom ribbon gallery control to display a collection of signatures.

bb gallery 3

That process has some advantages over the built-in galleries, but it takes a lot of work. While it looks slightly different, a similar result can be achieved with a built-in custom building block gallery.

bb gallery 4

As you can see in the illustration above, a built-in custom building block gallery can display multiple building block categories in the gallery.

If you are content to create your own building blocks one at a time and add them to one of the various built-in galleries, there is no point reading on. If, instead, you want a custom gallery where you can manage large numbers of building blocks in several categories, you will find the automated process and add-in provided below a real time-saver.

The Build & Deploy Custom BB Gallery template add-in comes with all the RibbonXML, VBA procedures, controls and sample tables to make adding, editing, or deleting large numbers of building blocks with a built-in custom gallery relatively effortless.

The add-in creates a new group on the Add-Ins tab "Greg Maxey's Custom BB Editor," a new button control in the "Text" group in the Insert tab, plus three commands and a custom building block gallery on the QAT.

bb gallery 5

bb gallery 6

bb gallery 7

The template contains a few sample tables (snippets of two tables are shown below) . Each sample table (and tables that you will add) represents a single building block category. The tables are used by the add-in to automatically create building block categories and building blocks. The first row of each table defines the building category. The second subsequent rows define the building block entry (first column), the building block name (second column) and the optional building block description (third column). You can edit the sample tables, delete the sample tables, and/or add and delete your own tables by opening the template using the Edit Entry Tables control on the Add-Ins tab or QAT. The entries in the tables shown below were used to create the built-in custom gallery shown previously.

bb gallery 8

Site Note IconNote: The "signatures" are pictures I inserted in the table cells. I used .png format image files I downloaded from the internet and a few .jpg image files I created myself.

Once you have your tables created and entries defined, you can process the tables individually or en masse to create the building blocks and categories using the "Add Category" ribbon or QAT commands. Pressing one of these commands opens the following Userform interface. This interface lists all of the tables available for processing. You can process a single table individually or process all tables.

Site Note IconNote: You cannot add a building block entry individually. If you want to add an individual building block to an existing category then you would open the template using "Edit Entry Tables," add a row to the existing table, define the building block and building block name, then add (re-add) the table using the "Add Category" command.

bb gallery 9
  bb gallery 10

Similarly you can delete one or all categories from your custom building block gallery by using  "Delete Category" commands on either the ribbon or the QAT. Pressing one of these commands opens the following Userform interface. This interface list categories in the the custom building block gallery. You can delete categories individually or en masse.

Site Note IconNotes:
     1. Deleting categories affects only the building block entries and organizational structure in the template. It does not alter the tables used to define the categories or building block entries in any way.

     2. You cannot delete building block entries individually. If you want to delete an individual building block, you will need to delete the category. To do this, open the template using "Edit Entry Tables," delete the row defining the building block entry, then add (re-add) the table using the "Add Category" command.

bb gallery 11

 bb gallery 12

Your custom-defined building block entries can now be deployed from the built-in custom gallery controls "My Gallery" on the Insert tab, or "Custom Gallery 1" on the QAT.

You can also deploy the custom built-in building block gallery directly in the document with a content control.

bb gallery 12
bb gallery 14
bb gallery 15
bb gallery 16

Site Note IconNote: Building block galleries employed in this manner function similarly to the AutoTextList field in Word 2003.

Just for fun, I have included a couple of turbo-charged versions of the basic template add-in. The first incorporates a custom ribbon tab and displays eight different built-in custom galleries on the ribbon.

bb gallery 17

Since I had already used and relabeled the Custom Gallery 1 as "My Gallery," I went ahead and relabeled Custom Gallery 2-5 as Custom Gallery 1-4. I also shanghaied the Custom Text Box Gallery and relabeled it "Pictures." I used this gallery because it provides a full page preview.

This version also lets you select a specific storage template.

bb gallery 18

The final version is similar to the turbo-charged version but allows you to work with any of the 35 building block galleries.

bb gallery 19

You can download and review all three versions of the add-in here: BB Custom Galleries.

Site Note icon For more on template add-ins and how to load them, see: Organizing Your Macros/Template Add-ins at: Installing Macros

That's it! I hope you have found this tips page useful and informative.



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