In my first blog post, I gave an overview of some of the concepts with respect to building blocks and several readers commented with questions/concerns with regard to the management of building blocks. I felt like this was a large enough topic that it was worth dedicating a post to. There are 2 aspects of management that I will cover in this post. First, I want to share a little bit about file level management/organization of building blocks and second, I will talk about sharing building blocks with other and within an organization.
File Management
By default,
Windows 7, there is a file called "Building Blocks.dotx" in your user application data folder (in Vista its "C:/Users/<<username>>/AppData/Roaming/Microsoft/Document Building Block"). This is where all of the built-in building blocks are saved, and it is also the default file that new building blocks are saved to. Whenever you open up one of the building block ##################, Word loads this document. As Stefan mentioned in his comment, there are a lot of building blocks in this file,
Windows 7 Professional, so it's easy to get them mixed up. And, this also makes it difficult to share building blocks between users. There are a couple of different things you can do to mitigate this. One of the easiest things to do is add a new template to the document building blocks folder. This works because Word doesn't just load Building Blocks.dotx,
Office Professional Plus 2010, but instead loads all the templates in the document building blocks folder. You can open a new blank document in word, then "save as" a template into that document building blocks folder. Now, when I save a building block (or auto text), I have the option of saving it to my new template. (In order to see the new template, you will need to restart Word.) Once I have done this, I can easily share my custom building blocks without sharing all the built-in content. Another hint is to use a different category for my personal building blocks. If you want this category to always appear above the built-in content, you can insert a space in from of the name (like " my building blocks") and your category will be at the top.
If you already have a bunch of personal building blocks, you can move them to a different template using the organizer. You can get to the building blocks organizer from the insert ribbon, by selecting "quick parts" and then choosing "Building Blocks Organizer…"
This opens up a dialog box that lets you view all the available building blocks. If you want to change the location of a building block, you can select it and then choose "Edit Properties." You can then drop down the "Save in:" box and pick your new template.
When you exit Word, you will be prompted with a message asking if you want to save your building blocks files. This also works to move building blocks into a document template if you are currently editing it. Unfortunately,
Microsoft Office Professional 2007, you can't copy a building block using the organizer, though you can write a macro. The following macro inserts a building block called "Random" into a document,
Office Enterprise 2007, and then saves it to another template called "Test" and then deletes the building block from the document.
Dim objTemplate As Template
Dim objBBs As BuildingBlockEntries
Dim objBlock As BuildingBlock
Dim objBlock2 As BuildingBlock
Dim objBBTemp As Template
Dim rangeValue As Range
Templates.LoadBuildingBlocks
For Each objTemplate In Templates
If objTemplate.Name = "Building Blocks.dotx" Then
Set objBBTemp = objTemplate
End If
Next objTemplate
Set objTemplate = ActiveDocument.AttachedTemplate
Set objBlock = objBBTemp.BuildingBlockTypes(wdTypeAutoText).Categ ories("General").BuildingBlocks("Random")
Set rangeValue = objBlock.Insert(Selection.Range)
Set objBlock2 = objTemplate.BuildingBlockEntries.Add(Name:="Test", Type:=wdTypeAutoText, Category:="General", Range:=rangeValue)
rangeValue.Delete
Sharing Building Blocks
Koen asked about administrating building blocks in an organization. The easiest way to do this is to add value called "SharedDocumentParts" to the "HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\ Common\General" registry key. You can set this to tell Word an additional location to look for document parts. The best thing to do is to point this at a shared network directory. That way everyone has access to the same building blocks. Also, like the Document Building Blocks folder, Word will load all the templates in this location so you can save them in many different files if you would like to. Additionally, if you are already sharing a global template within your organization, you can also save the building blocks in that template.
Stay tuned for some tips on templates and building blocks.
Happy Building.
-Jodie
<div