![]() ![]() The VBE should be configured as shown below:.Using the dropdown at top right of the code pane, select ContentConrtrolOnExit. ![]() Using the dropdown at top left of the code pane, select the "Document" object.Using the Project Explorer, drill down and select the project "Template Project (Demo), expand the project and double-click the "ThisDocument" module. Note: A template isn't necessary for this review, but we will be using features of a template as the examples are developed so we might as well start with one now. For the purpose of the illustrations that follow I saved the document to my desktop using the name "Demo.dotm" Save the new document as a Word macro-enabled template.The following steps provide a working example and review of the event. Understanding this event is key to examples that follow. This is a built-in document event that you can leverage each time your document user exits a document content control range. OnExit Event:īefore getting to the examples I want to ensure that all visitors to this page are familiar with the Document_ContentControlOnExit event. Most of the examples could easily be adapted to include the insertion of data from other external sources (e.g., Excel or Access). Note: I have limited the discussion and examples in this page to Microsoft Word. It can also include text strings included in VBA procedures or even document variables.įriend and frequent tips project collaborator Graham Mayor provides a similar discussion and examples for inserting content based on a user selection or entry in legacy form fields: Insert content from a form fieldįor more on Content Controls see: Content Controls The source of the defined content can include text and graphics stored in other Word documents or text and graphics stored as Building Blocks in the document template or other external template (e.g., the Word Built-In Building Blocks.dotx). For full instructions on developing forms using Content Controls, run a search on "Create forms that users complete in Word 2007" and select the help option: Word > Creating specific documents > Forms.įor the developer perspective on Content Controls, you may want to check out this overview.The purpose of this Microsoft Word Tips & Microsoft Word Help page is to review/introduce readers to the Document_ContentControlOnExit event and illustrate several methods that you can use to insert defined content (text or graphics) into your Word documents based on a selection or entry the document user makes in the document content controls This is a significant new area that is well documented in the on-line help system. You can build forms using Content Controls. Click Design Mode to toggle Design Mode off and see how the Content Control will display in a document.įor full instructions on working with each of the following Content Controls, use the on-line help system, run a search on "Content Controls" and select the help option: Word > Creating specific documents > Forms.Complete the fields in the dialog box as required.With your cursor in the field you have just created, click Properties, to display the Content Control Properties dialog box.You can set an option that automatically removes all your content when the user starts typing in the control. You can type very detailed instructions here, formatted in any way you like. Type any changes you want to make to the Place Holder text.Click the Aa button to insert a Rich Text content control.Back in your document, click on the Developer tab, and identify the Controls group.With Popular highlighted, tick Show Developer tab.Click the Office button, Word Options to display the Word Options dialog box.For this you will need the Developer tab. If you are creating templates for others to use, you may want to create content control fields like these. (Note that this option is only available if the template designer made it available.) You are returned to the document and there is no longer a Place Holder. When you type your own text in the brackets, the Place Holder disappears and just your own text remains. When you click on one of these, a box displays around it. Look at the instructions surrounded by square brackets – these are called Place Holders.Find and click on Median Letter, then click Create.These are the templates supplied by default with Microsoft Word 2007. From the Templates frame click Installed Templates.In Microsoft Word, click Office, New to display the New Document dialog box.The best way to see what these are is to open one of the new boilerplate templates in Word 2007 and have a look. You may want to create customised templates, such as corporate forms, or letter or fax templates, that use your own theme and that use Content Control fields. Content Controls are another new feature of Microsoft Word 2007. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |