views:

33

answers:

1

I need to create a Building Block Gallery with defined Content Controls to make it easy for others to create word documents that would be ready to accept my data. I'm trying to make this as painless for the users as possible.

I wanted to make sure all this would be professionally done and look good so I wan't to make sure all the Content Controls are basically the same just with different Names/tags and original content. Doing this inside Word isn't so easy and would take some time. Sometimes when I change the Content inside it changes from the greytext to the standard and sometimes it doesn't ( not sure why, think it has to do with how I overwrite the "place text here" thing). So I thought doing it programatically would work.

Then I read in some OpenXML FAQ that this isn't possible. Somthing that I do not understand. If I store the Building Block inside a .dotx file it mus be somewhere inside the XML there right? I should be able to access it. Where is it stored?

I would be greatful for pointers here, mainly the answer to the question how do I create multiple Content Controls inside a custom Building Block gallery.

+2  A: 

Content controls can live inside building blocks just fine. In fact, most of the built-in building blocks that Word 2007 ship with include content controls inside them.

The shipping building blocks are stored:

  • In Word 2007: "%appdata%\Microsoft\Document Building Blocks\1033\12\Building Blocks.dotx"
  • In Word 2010: "%appdata%\Microsoft\Document Building Blocks\1033\14\Built-In Building Blocks.dotx".

I think you can create your own .dotx file (with its own building blocks) and place it in the same folder to get Word to load it on boot.

In the .dotx file itself, its stored under \word\glossary\document.xml.

I'd be surprised if you couldn't create a building block entry that had content controls in it manually, at least. I don't know if the OpenXML SDK can do it - when it's mentioned that it isn't possible, it just might be that it doesn't have the capability to do so, and not that it's technically impossible.

Jonathan Yee
After checking it out myself it seems that it's possible, but maybe not suggested. It doesn't seem to give it it's own ID. That might cause some problems. I think I will just create a the amount I need in Word and then change them using OpenXML or just XML to how I wan't them. Then they will include the Id's as well. BTW it seems to be stored inside the Glossary part of the document.
Ingó Vals