MS Word: How to effectively create Building blocks?

I need to create a Building Block gallery with certain content controls so that others can create text documents that are ready to accept my data. I am trying to make this as painless as possible for users.

I wanted to make sure that all this would be professionally done and look good, so I do not want all the content controls to be basically the same with different names / tags and original content. Doing this inside Word is not easy and will take some time. Sometimes, when I change the content inside, it changes from greytext to the standard, and sometimes not (I don’t know why, I think this is due to the way I rewrite "place for text here"). So I thought this would work programmatically.

Then I read in some OpenXML FAQs that this is not possible. Something I don’t understand. If I store the Building Block inside a .dotx file, will it be somewhere inside the XML there? I must have access to it. Where is it stored?

I would really like here, mainly, the answer to the question of how to create several content controls inside the Building Block user gallery.

+3
source share
2 answers

Content controls can live perfectly inside building blocks. In fact, most of the built-in building blocks that Word 2007 ships with contain content controls.

Building blocks are saved:

  • In Word 2007: "% appdata% \ Microsoft \ Document Creation Unit \ 1033 \ 12 \ Building Blocks.dotx"
  • In Word 2010: "% appdata% \ Microsoft \ Document Block Blocks \ 1033 \ 14 \ Embedded Building Blocks.dotx."

, .dotx ( ) , Word .

.dotx \word\glossary\document.xml.

, , , , . , SDK OpenXML - , , , , , .

+2

, , , - ...

VBA ( VSTO) Building Blocks ( ). , ( ).

Build Blocks% appdata%\Microsoft\Document Building Blocks\1033\14\Custom Building Blocks.dotx ", 1033 - , 14 - Office (13 = Office 2007, 14 == Office 2010, 15 == Office 2013 ..).

, , XML Open Office.

0

Source: https://habr.com/ru/post/1758932/


All Articles