Welcome to MSDN Blogs Sign in | Join | Help

The Microsoft Office Word Team's Blog

All things Microsoft Office Word, from the Word team.
Creating Building Blocks

In my last two posts I talked about building blocks in general and how to insert and swap out building blocks. In today's post I am going to talk about how to create your own building blocks.

Creating Your Own Building blocks

As mentioned in my first post, there are several different types of Word 2007 galleries that contain building blocks from cover pages and headers to equations and watermarks. When creating your own custom building blocks you may add the building block to any of the Word 2007 galleries. There are several ways you can accomplish the task of adding a building block to one of the Word 2007 galleries:

  1. Select content and save selection to specific gallery
  2. Select content and hit Alt-F3
  3. Modify WordML within either the building blocks template, the Word normal template, any custom template

Option 1: Select content and save selection to specific gallery

Every gallery that contains building blocks has a command that allows you to save a selection directly to that specific gallery as a building block. The command can be found at the bottom of every gallery. Take for example the Cover Page gallery:


The command is only enabled when you have content selected. Clicking on this command will then result in the following dialog box:

In this dialog box, you can select the name, description, gallery and category for the building block you are about to save. All these options allow you to control how the content is presented in the user interface and where the content will reside. By default the gallery option will be the gallery from which you clicked the Save Selection command. In this case, the gallery selected is Cover Pages.

Option 2: Select content and hit Alt-F3

This brings up the same dialogue box as option one, but the default gallery selection will be Quick Parts.

Option 3: Modify WordML within either the building blocks template, the Word normal template, any custom template

This option is more involved than the first two and requires a more in depth knowledge of WordML, which is covered in the following posts:

The contents of all building block galleries are stored in templates. There are several locations you can select from when choosing where to save your building block:

  1. Word's building blocks template
  2. Word's Normal template
  3. Any custom template

I will talk more about the difference between these three locations in my next post when I talk about how to deploy your building blocks.

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

Zeyad Rajabi

Posted: Wednesday, January 03, 2007 1:51 AM by wrdblog
Filed under:

Comments

Richard (richard@lbrc.org) said:

Zeyad,

I tried this for a new cover page, but I got stuck.  I have a nice cover page with several text boxes and pictures on it that I'd like to save as a building block.  But, I can't find a way of selecting the text boxes and pictures - I could't find a "Select Page" features, and CRTL-CLICK doesn't seem to like selecting pictures and text boxes.

Is it just me, or is this harder than it should be?

R.

# January 3, 2007 5:25 AM

wrdblog said:

Did you try mouse highlighting the entire page of interest? That should select all content as well as objects on that page. When selecting content it will look like the text boxes are not selected, but they are indeed selected and is apparent when you do a copy paste action. Let me know if that works for you.

Zeyad Rajabi (MS)

# January 3, 2007 2:37 PM

Tim said:

Thanks for the series Zeyad - helpful

if i create a template like this can i then distribute it to other users on my network- how should i go about that?

# January 3, 2007 10:22 PM

wrdblog said:

Tim – That is a great question that I will answer in depth in my next post when I talk about how to deploy building blocks.

Zeyad Rajabi (MS)

# January 4, 2007 12:28 PM

Mike said:

When MSFT took out the Word document project template from the new VS 2005 VSTO package they took away some real power.

Is there a way to databind a Word 2007 ContentControl to a Sql Server 2005 datasource property??

It looks now like I have to fetch from the DB and then write to XML and then XML map to the word document, what a pain!

# January 4, 2007 2:47 PM

RIchard Black said:

>>Did you try mouse highlighting the entire page of interest?

Zeyad,

Thank-you for pointing this out - I had assumed because nothing was highlighted, nothing would be saved - but as you say - it just works anyway!

Thanks,

R.

# January 4, 2007 4:14 PM

Stefan KZVB said:

I'm looking forward to your post on the deployment of building blocks! Could you please tell there if it is possible to deploy a corporate-wide building blocks.dotx write-protected for users? Can it be be put in a shared server folder for use by multiple clients? (Maybe simply by directing Word's start-folder to a network folder and putting a dotx there? With Word 2000 we put vba solution dots and dots with corporate-wide autotext entries on shared server folders which are write-protected for users - this works fine).

Furthermore is it possible to deploy a customized building blocks.dotx which does not have all the default content? It would be best if it was restored to its initial customized state upon Word's start when the building blocks.dotx was deleted.

# January 5, 2007 6:56 AM

Elementalist said:

I'm a developer who made heavy use of autotexts with Word2002. One thing I always wanted to do was 'load' building blocks from a database (or elsewhere) and use them while a user was in the document. You mention that BBs can be modified using WordML in the template, but can this be done when the template is 'in use', i.e. the user has the attached document open and wants the modified BB there-and-then?

I know a lot can be done with the new open XML file formats, but it all seems to be 'offline' only.

# January 10, 2007 5:19 AM

Mike Ormond's Blog said:

My Office Open XML File Format nuggets have all been published at http://www.microsoft.com/uk/msdn/events/nuggets.aspx

# May 24, 2007 7:09 AM

The Microsoft Office Word Team's Blog said:

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

# December 17, 2008 2:48 PM

Community Server Blogcrew said:

Building Blocks I'm Jodie Boyer, the newest PM on the Word Team. I joined the Word team 6 months ago

# January 29, 2009 5:25 PM
New Comments to this post are disabled
Page view tracker