Welcome to MSDN Blogs Sign in | Join | Help

Deploying Building Blocks

In my last three posts I talked about building blocks in general , how to insert and swap out building blocks, and creating building blocks. In today's post I am going to talk about how to deploy your customized building blocks to users. Deploying building blocks is cool because you can push out content for other people to reuse. Think copy and paste to the next level.

Here is a cool scenario:

Let's say you are lawyer who works on legal contracts all the time. You always use the same clauses in certain types of contracts. Instead of copy and pasting from previous documents you save your clause as a building block. Every time you create a new document you then add that clause to your contract by simply using the appropriate building block. Now that you saved time for yourself you decide to help other people out by deploying your custom built building blocks to other people. You are now the hero of your organization because you saved them a bunch of time.

Deploying Building Blocks

As mentioned in my first post, building blocks are essentially parts of a document that can be reused. All building blocks are contained in galleries in the UI for easy use. Where are these building blocks stored? The simple answer is that the contents of all building block galleries are stored in templates. Specifically, there are several locations you can save your building block content in:

  1. Word's building blocks template
  2. Word's Normal template
  3. Any custom template
    1. For usage with a specific type of document
    2. For usage across all documents

These options are provided to you in the Create New Building Block dialog under the field for Save in when you save a selection as a building block.

Word's Building Blocks Template

All Word built-in building block content is stored in Word's building blocks template, Building Blocks.dotx. For example, out of the box cover page galleries, text box galleries, and equation galleries are all stored in this template. By default, Word selects this building block template as the location to store building blocks. This template is stored in the Document Building Blocks directory (%appdata%\Microsoft\Document Building Blocks). This building blocks template can be distributed to others as long as it is saved in the appropriate directory.

Word's Normal Template

You could also store general purpose content in the Normal template. This option is only recommended if a corporation distributes Normal.dot across the company.

Note: In general, it is recommended that you do not store building blocks in this template as Normal.dot is often deleted during customer support and multi-lingual scenarios when the language is changed.

Custom Template

There are two main scenarios you can accomplish by saving building blocks in a custom template:

  1. Have specific building blocks available to a customized type of document that is based off of a template
  2. Have building blocks available for all documents, where building blocks are stored in custom templates

If you're putting together a template for a specific kind of document, say a financial report, you can save building blocks into your own custom template. When you create documents based on this template, you will see cover pages, headers, footers, etc. tailored to the specific kind of document. These document-specific building blocks are only available when users are working on documents based on the custom template. Simply distributing the custom template will make those building blocks available to others.

For building blocks that you want to make available for all documents you work on, you can put a template containing them in the Document Building Blocks directory (%appdata%\Microsoft\Document Building Blocks). You can put your own templates directly in the main directory, or within a sub-folder corresponding to a specific language (e.g. the 1033 sub-folder contains parts in English). Word will automatically load any template added to the Document Building Blocks or sub-folder directories in order to combine all of your building blocks for usage in the various galleries. Word building block templates act merely as building block libraries, not as templates that you would base documents on. Deploying the document building blocks directory or custom templates within the directory will allow others to use your building blocks.

Note: If you decide to put your templates in a language sub-folder, Word will only load the parts corresponding to the language of the user interface and to the primary editing language.

Let me know if you have any specific questions or comments.

Zeyad Rajabi

Published Tuesday, February 20, 2007 1:06 AM by wrdblog

Comments

# re: Deploying Building Blocks

This is all very cool, but isn't there a way to allow users to select a building block without distributing the building block template to their local machine? Can Word look to a template on the local network or on SharePoint for building blocks?

Tuesday, February 20, 2007 11:06 AM by Eric

# re: Deploying Building Blocks

I like the idea of the templates being on the local network. but it can it be taken a step further and integrated with AD and group policy to get changes pushed out to users on a timely basis.

Tuesday, February 20, 2007 1:00 PM by Michael Palecek

# re: Deploying Building Blocks

Eric - Yes you can deploy building blocks to a network by using the Workgroup template. More information can be found here: http://office.microsoft.com/en-us/word/HP030827251033.aspx

Michael – Could you elaborate more on your question? Our deployment mechanism simply ensures that Word opens building blocks from an arbitrary share.

Zeyad Rajabi (MS)

Tuesday, February 20, 2007 3:08 PM by wrdblog

# re: Deploying Building Blocks

I think you can also set a registry key to tell Word where to look for Shared Building Blocks on the network:

[HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Common\General]

"SharedDocumentParts"="N:\\V_O2007\\WWD2007\\Templates\\DocParts"

Just put your docx-files containing the building blocks in the specified path.

@Zeyad Rajabi: Is there a comfortable way to copy (not just move) building block entries to another template? Like you can do it with "Styles" and "Macros" in the "Organize Dialog"?

Wednesday, February 21, 2007 4:45 AM by Stefan KZVB

# re: Deploying Building Blocks

Thanks for the response. I have tried deploying through the Workgroup Templates location but that does not seem to work because the building blocks in those templates are not loaded unless the template itself is being used. What I am looking for is a place to specify a "Workgroup Building Blocks" location, so to speak, where those building blocks are loaded by Word no matter what template you're using. But it sounds like that does not exist. Would editing the registry key (as described above) be the only solution then?

Wednesday, February 21, 2007 11:54 AM by Eric

# re: Deploying Building Blocks

Zeyad,

Sorry to disrupt the flow; however I am a relative newbie needing to get an answer to a question that parallels much of the content I have perused in these related blogs.  Question: If I have a Word 2007 template that I want to update 'on the fly' with 'data' (read, spider graphs and tables of aggregated findings generated by SSRS 2005 in XML) can these be mapped to the .docx?  Is this a web service of queries to create the XML data store? Or is it possible/preferable to render from SSRS 2005 to Word directly?  Forgive my naivete and thanks for pointing me in the right direction.

Wednesday, February 21, 2007 2:00 PM by Joe Gannon

# re: Deploying Building Blocks

Hi,

I have a problem with Shared Building Blocks in template file (.dotx - Word 2007).

I put on a network share a word 2007 template file "BuildingBlocks.dotx".

I set the following registry key to tell Word where to look for Shared Building Blocks on the network :

***

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Common\General]

"SharedDocumentParts"="\\\\\\\\Server\\\\Directory\\\\BuildingBlocksDirectory"

***

I create a new document and i can see and insert QuickParts, AutoText, etc... (from my custom shared building blocks on the network share) in my document.

I save and close my document... before the closing of Word, the Shared Building Blocks template file must be save, it seam be logical !

"You have modified styles, building blocks (such as cover pages or headers), or other content that is stored in foobar.dotx. Do you want to save changes to foobar.dotx ?

After a Yes click, Word tell me that the file is read-only (but I am sure that it was not read-only before start Word).

I can understand that this template file is read-only for other users but why for me ?

Thank you for your help

Thursday, February 22, 2007 1:24 PM by fsug

# re: Managing Building Blocks

Great article. I have several questions/comments about building blocks.

1. It would be nice to have programmatic access the Building Block preview control via Word 2007 object model.

For example, I am programming a custom userform for displaying my firm's building blocks. I would like to add the building block preview window to my form.

Alternatively, I would like the ability to display the dialog wdDialogBuildingBlockOrganizer with arguments, such as show only the building blocks that are a certain type or category.

2. Did you ever get an answer to the above question: Is there a comfortable way to copy (not just move) building block entries to another template? Like you can do it with "Styles" and "Macros" in the "Organize Dialog"?

3. Finally, when creating a new building block, what is the implication of choosing the type "header" vs "custom header"?

Friday, February 23, 2007 1:07 PM by Karen

# re: Deploying Building Blocks

@Karen:

I did not get any answer on #2. Still hope there's a way to copy building block entries comfortably.

I couldn't figure out #3 yet either. Hope you get some answers from the Word Team soon.

@all:

Has anybody got the issue that in Word and Powerpoint (not Excel) if you select "Convert" on old format files from the Office Menu the old file format-file is NOT deleted as described in the dialog before conversion? I couldn't find a KB-article on it but that's essential and should be corrected if it's a bug.

I also figured out that Powerpoint old format file conversion/automatic old file deletion works on the local drive but not on network. With Word it worked neither locally nor on network. It really seems to me there are some issues with Office 2007 and files on network shares - as I described earlier in this blog. But I did not get any confirmation or find a KB article on it either yet.

I also know of the OFC-Tool for format conversions but this option also has some issues which makes it unnecessary hard to use:

- it converts to a different folder instead of replacing successfully migrated files

- I get non-convertable errors on files which can be manually converted fine with Word 2007 RTM

- maybe I've done something wrong but the OFC-Tool produced no log file. I'm using OMPM version 2 from Feb, 19th

Monday, February 26, 2007 6:02 AM by Stefan KZVB

# re: Deploying Building Blocks

hey and thanx for the articles! that will help me very much!

is there a (easy) way to change the building blocks or do i have to readd them?

thanx you for your answer.

thomas

Monday, February 26, 2007 10:55 AM by thomas

# re: Deploying Building Blocks

Stefan – There is no easy way to copy building blocks to another template.

Fsug – We will need to investigate the issue some more on our side. There may be a bug here.

Karen – There is no programmatic way to access the building block preview control. The custom header and header should be treated as exchangeable. Having a custom header vs. regular header allows you to differentiate between built in building blocks vs. custom building blocks.

Thomas – Sorry there is no easy way to change building blocks without re-adding them back.

Zeyad Rajabi (MS)

Monday, February 26, 2007 7:10 PM by wrdblog

# Building Blocks

I'm Jodie Boyer, the newest PM on the Word Team. I joined the Word team 6 months ago after spending 5

Wednesday, December 17, 2008 2:49 PM by The Microsoft Office Word Team's Blog
New Comments to this post are disabled
 
Page view tracker