- In computing, a legacy system is an old method, technology, computer system, or application program, 'of, relating to, or being a previous or outdated computer system,' yet still in use. Often referencing a system as 'legacy' means that it paved the way for the standards that would follow it. This can also imply that the system is out of date.
- T he purpose of this Microsoft Word Tips & Microsoft Word Help page is to publish and describe my 'Content Control Tools' Word template add-in. A general description of content controls with links to several related tips pages is available here: Content Controls.
The Anchorage
How to find tools options in office 2010. Different between 2003 and 2010 in tools options, Options in Tools office 2010. User friendly in 2010 tools options. This article provides steps to convert legacy.doc Word files to the Open Office XML format. To Convert to a Microsoft Word 2007 Document. Click the Office button (located in the top left-hand corner), and then select Convert. To Convert to a Microsoft Word 2010 or 2013. Select the File tab. Click the Convert button in the backstage view.
Personal website of Gregory K. Maxey, Commander USN (Retired)
Do you have ad-blocking software enabled? While I respect your right to do so, your donations and the minimal advertisements on this site help to defray internet and other costs of providing this content. Please consider excluding this website from blocking or turning off the blocker while browsing this site.
DISCLAIMER/TERMS OF USE
The information, illustrations and code contained in my 'Microsoft Word Tips' are provided free and without risk or obligation.
However, the work is mine. If you use it for commercial purposes or benefit from my efforts through income earned or time saved then a donation, however small, will help to ensure the continued availability of this resource.
If you would like to donate, please use the appropriate donate button to access PayPal. Thank you!
The purpose of this Microsoft Word Tips & Microsoft Word Help page is to publish and describe my 'Content Control Tools' Word template add-in.
A general description of content controls with links to several related tips pages is available here: Content Controls.
Background
The Content Controls Tools add-in leverages many of the techniques and processes published in earlier pages and brings those processes together with several new features into one compact add-in tool that you can use to empower content controls and simplify working with them in your templates and documents.
Note: This tips page was created using screen graphics from Word 2013 & 2010. Several advanced features of the add-in (e.g., rich text content control mapping) are not available in earlier Word versions. If you have an earlier Word version then your actual display when using the add-in will appear differently.
Working on this project was like solving a riddle and it was by far more ambitious and time consuming of any project before it. With each step it seemed that I would stumble on or uncover a new complication. Thanks for all the feedback from users. Through that feedback I have been able to track down and resolve many issues that I hadn't discovered on my own.
Version History
- Version 1.0 - Initial release
- Version 1.1 - Enables users to suppress printing content control placeholder text and fixed several minor bugs reported by users.
- Version 1.2 - Corrects an error that occurred if users tried to populate a mapped dropdown list or combobox content control using an external Excel list, and adds the ability to map each content control to its own unique node using the InstaMap© feature
- Version 1.3 - This version corrects an error that occurred if you tried to create, nest and mapped a rich text content control in another mapped parent rich text control. Code changes allow you to create and map contents controls with selected content and improves error handling if you attempt to create a control at a restricted location.
- Version 1.3.1 - This version refines handling of the built-in notification dialog if you attempt to insert content controls at a invalid selection.
- Version 1.4 - Resolves bug with 'QuickPrint' associated with suppressing Placeholder Text.
- Version 1.5 - Adds the option to exclude content controls already mapped to a built-in CustomXMLPart (e.g., certain document properties) with using InstaMap©.
- Version 1.6 - Fixed bug which prevented plain text controls with multiple lines of text from being mapped.
- Version 1.7 - Fixed a code error which prevented the add-in from deleting some content controls when the content control 'lock contents' attribute is set.
- Version 1.8 through 2.1 - Were a bit of a wandering period. I was working with a large government agency that was looking for some specialized features. Primarily a feature to 'flag' CCs in a document that were mapped. I later discovered that feature introduced complications in some of the advanced mapping processes and deleted it.
- Version 2.2 - Removes the mapped content control flagging feature and addresses user feedback on the Suppress Placeholder Text feature.
- Version 2.3 - Revised code to better handle documents with an unusually large number of content controls. Removed feature to suppress PHT for picture content controls.
- Versions 2.4 & 2.5 - Minor bug fixes
- Version 2.6 - Added the ability to skip individual or skip all untitled content controls with InstaMap©. Content control 'ID' is copied to the clipboard by clicking on the 'ID' information label.
- Version 2.7 - Minor bug fix.
- Version 3.0 - Introduces a compact utility to review and title/tag content controls and a utility to convert formfields to content controls.
- Version 3.1 - Corrects a code error in the InstaMap process.
- Version 3.2 - Minor bug fix.
- Version 3.3 - Minor bug fix.
- Version 3.4 - Introduces a compact utility to Convert ActiveX Controls to Content Control Utility
- Version 3.5 - Introduces utilities to Convert Bookmarks to Content Controls, Find and Replace Text with Content Controls and Mass Update Content Controls based on Properties of Selected Content Controls.
- Version 4.1 - Provides enhancements to the Advanced Mapping and InstaMap feature of Content Control Tools and facilitates mapping Rich Text Content Controls that contain a table at or near the end of the content control range (see anomalies section and discussion below).
- Version 4.2 - Corrects error with copy XPath to clipboard, improves the process for listing document content controls in the Single CC Tools and Global CC Tools page tabs, enhances and corrects errors in the Convert CC to text and Delete CCcontent processes. Adds a process to shade/remove shading from content control content. Adds a process to Clear CC content.
- Version 4.3 - Minor bug fix
- Version 4.4 - Resolved error that occurred if a Group type content control was encountered in a delete CC/Content operation.
Limitations/Anomalies/Observations
- I have made considerable effort to make the add-in compatible with the processes native in Word 2013-2019 with respect to content control mapping. When using the add-in, be aware that some mapping processes are not possible. For example, you cannot create, nest and map a rich text content control in a parent mapped rich text content control.
- These limitations can cause a previously mapped content control to lose its association with its corresponding CusomXMLNode. For example, if you first create, nest and map a rich text content control in an unmapped rich text content control and then later map the parent rich text control the mapping to the nested control mapping will be lost.
- You can select a frame and then using the developer tab you can insert all types of content controls at the frame range. However, if you inserted a rich text or repeating section content control at the frame range and later map that content control with Word's built-in mapping tools, the frame is destroyed and the mapped control is repositioned at the former frame anchor range. This apparently is a limitation with Word. Accordingly, if you insert and map a rich text or repeating section content control at a frame range using this add-in the frame will be destroyed.
- By far the most disappointing, is the degraded performance and display delay in documents with large numbers of content controls. Disappointing because I am unable to find any reliable method to improve it. This issue it tied to the total count of content controls in a document, the looping processes to display the interface and the performance degradation inherent with VBA For Each ... Next loops as the size of a collection increases.
- Rich Text content controls containing a table at/near the end of the content control range can cause seemingly no end of frustration for a VBA developer. The boundary between the table range end and content control range is broken pure and simple. The add-in uses internal processes to work around this condition and facilitate mapping. See section on mapping rich text content controls containing tables below.
User Interface
Ribbon and QAT
The add-in user interface consists of a userform that is initiated from either a control on the ribbon add-ins tab or quick access toolbar (QAT). The ribbon and QAT controls are shown below.
Userform
Clicking either control displays the add-in userform. Tabs on the form's multi-page control are used to configure the add-in for six basic functions:
- Tools for and data related to individual content controls.
- Global tools for working simultaneously with multiple content controls.
- Basic content control mapping.
- Advanced content control mapping and tools for working with CustomXMLParts.
- InstaMap©. A single-click utility to map all qualified document content controls.
- Utilities.
Below the multi-page control are a common notification frame and command button controls.
Notes:
1. The selected page tab when the userform is displayed depends on what content controls, if any, are present in the document. If there are no content controls in the document the 'Basic Mapping' tab is selected and the Single and Global tools tabs as are disabled as shown below.
2. Some of the graphics used to publish this tips page may not faithfully reflect the current configuration of the add-in or display the current version number. I will attempt to note differences when they occur.
Functional Description
Basic Mapping
The Basic Mapping page is displayed by default when the add-in is initiated and there are no content controls contained in the document. In this situation, the 'Map Selected Content Control' command button is naturally disabled.
Note: In Word 2010, the 'Rich Text' command button is disabled. In Word 2007, the 'Rich Text' and 'Checkbox' command buttons are disabled.
Clicking an enabled content control type button initiates a process to create and insert a new mapped content control in the document at the insertion pointselection.
Note: You would typically insert content controls with the selection collapsed to the insertion point. However, if content (e.g., text or graphic) is selected the add-in will perform and alert you to invalid actions just as if you had used the controls on the Developer tab to create and insert content controls.
For this example, I clicked the 'Plain Text' command button.
First you are is prompted to provide a valid content control title.
Because the new content control will be bound (mapped) to a data node in a document CustomXMLPart, automatically created by the add-in, and the defined title is used to define the node name, the title must:
- Begin with a alpha character (i.e., A-z).
- Contain only alphanumeric characters, periods, spaces or the underscore '_' character thereafter (i.e., A-z,0-9,. _).
The use of other characters in the title could result in an invalid CustomXMLNode name and is therefore prohibited.
Note: If your final content control title must contain special characters e.g., 'Name & Address,' then you can change the title of the content control in the finished template/document after all mapping procedures using the add-in are finished.
Entering a valid title enables the 'Add & Map' command button.
Clicking Add & Mapp displays the built-in content controls properties dialog preset with the title you previously defined.
Using this dialog, you can set other properties as required. When finished, click the 'OK' button.
Note: Due to an apparent design oversight in Word, clicking 'Cancel' on the properties dialog box cannot be detected programmatically. Therefore, clicking 'Cancel' when using this add-in with any Word version will simply ignore any property settings you make. It will not cancel or reverse the process of inserting the defined control in the document.
The following shows the userform after the content control is created, mapped and inserted in the document. As the document now contains a content control, the Single CC DataTools, Global CC Tools and InstaMap© page tabs are enabled.
Qualified content controls with valid titles that exist in a document when the add-in is initiated can be mapped and bound to a data node using the Map Selected Content Control command button.
To map an existing content control:
- Ensure the content control title meets the criteria defined above.
- Select (click on the content control's title tab) the content control.
- Click Map Selected Content Control on the Basic Mapping page tab.
Notes:
1. Untitled content controls or content controls with invalid titles cannot be mapped.
2. Once mapped, a content control can be copied and then pasted to one or more other locations within the document. The original and each copy are linked together and to the CustomXML data node. Data entered in any of the linked controls is repeated at each linked control location and stored in the data node.
Note: When using the Basic Mapping tools, each content control you create and map is bound to its own unique data node. This means if you create and map two or more content controls using the same title, then your document CustomXMLPart will have two or more data nodes with the same name. There is no relationship created between the two controls. Therefore, if your intent is for your like titled content controls to act as clones to one another, you should simply create and map one content control and then copy and paste that control as required. This way each like titled control is bound to the same data node.
Advanced Mapping
The Advanced Mapping page provides utilities for viewing and working with document CustomXMLParts and several advanced mapping capabilities. Using the controls on the Advanced Mapping page you can:
- View a list of all CustomXMLParts in the document.
- Display the structurecontent of a selected CustomXMLPart.
- Add a new CustomXMLPart from an external file.
- View the XML script of a selected CustomXMLPart (uses NotePad).
- Delete a single selected CustomXMLPart or single selected CustomXMLNode (except built-in parts/nodes).
- Delete all CustomXMLParts (except built-in parts).
- Output the CustomXMLPart text content to a Word document.
- Add a predefined CustomXMLPart named 'CC_Mapping_Part.'
- Insert a CustomXMLNode in a CustomXMLPart (except built-in parts).
- Append a CustomXMLNode in a CustomXMLPart (except built-in parts).
- Delete a CustomXMLNode
- Delete all child nodes of a CustomXMLNode
- Clear/reset content of a CustomXMLNode.
- Map content controls to a selected CustomXMLNode.
- View the content and XPath of a selected CustomXMLNode.
- Create a building block (templates only).
Note: With Word 2007 and all subsequent version, document contains three built-in CustomXMLParts. You can use these parts for content control mapping, but you cannot delete these CustomXMLParts, or insert, append or delete CustomXMLNodes associated with these parts.
Previously, I defined and created a mapped plain text content control titled 'Client Name' using the Basic Mapping tools. Continuing that demonstration, I have now clicked the Advanced Mapping tab shown below:
Notice the Custom XML Part combobox control displays 'http://TheAnchorage/XMLPart' This is the namespace (or identifier) of the default CustomXMLPart created automatically by the add-in when I created the content control 'Client Name' using the Basic Mapping tools.
All controls created and mapped using the Basic Mapping tools are mapped to this CustomXMLPart. The default CustomXMLPart has six (6) predefined mapping nodes which you can use to create content controls using the selected node mapping tools (discussed below) or delete at your discretion.
Notice the CustomXMLNode 'Client_Name' was appended to the root node 'CC_Map_Root.' All content controls created using the Basic Mapping tools will have an associated CustomXMLNode appended to the root node.
Note: CustomXMLNode names cannot have spaces. Any spaces you use in defining node names or content control titles are converted by the add-in to underscore '_' characters.
Some command buttons on the Advanced Mapping page will be disabled or change appearance depending on the status of the CustomXMLParts and what you are doing with the tools. For example, in the illustration above Add Predefined XMLPart, Insert XML Node and Reset/Clear Node are disabled:
- Add Predefined Part is disabled because the predefined XMLPart already exists and is displayed.
- Insert XML Node is disabled because the root node CC_Map_Root is selected. Nodes can only be inserted above selected element nodes.
- Reset/Clear Node is disabled because the root node cannot be reset or cleared.
Selected Node Mapping Tools
Using the Advance Mapping 'Selected Node Mapping Tools,' you can create and map all qualified content control types in your document or template. To enable the Selected Node Mapping Tools, click on the node you want to use and then right click:
Notes:
1. With Word 2013 and later, Selected Node Mapping Tools enable you to create and map building block gallery and repeating section content controls.
2. Content controls (except repeating section content controls) can only be mapped to single 'childless' element nodes. If you map a content control to a single childless node and later append one or more child nodes to that node, the mapping will be lost.
Click 'Action unavailable' when displayed for an explanation of the mapping restriction.
After you select the type of content control you want to map to a node and create, the built-in content control dialog box is displayed. Using the dialog, you can assign a title and set other properties as required. Clicking 'OK' in the dialog will complete the action.
Note: As you are mapping to a predefined CustomXMLNode, there is no restriction on the title you assign the control. However, I feel it is a best practice to assign content control titles that match the associated node name. Remember, spaces in content control titles are converted to '_' in the associated node name.
In the illustration below, I've used the 'Delete XML Node' button to delete unwanted nodes in the CustomXMLPart.
Here I have deleted the last predefined node, selected the root node and appended several new nodes to the root node.
Note: Append adds (appends) a new child node to the selected root or other parent node. Insert adds (inserts) a new sibling node above the selected node.
Now I can use the Selected Node Mapping Tools and these new nodes to create and map content controls. Or, I can use an existing document content control using Map to Selected Content Control.
Custom XML Parts List
The Custom XML Part combobox lists all CustomXMLParts in the active documenttemplate. Using this list, you can select and view individual CustomXMLParts or add parts from external XML format files.
View Nodes
Using the 'View Nodes' option button allows you to review the content and XPath of a selected node. In the illustration below I have selected the built-in CustomXMLPart 'core-properties' and selected the 'creator' node. Data in this node is associated with the Document Property 'Author.'
XPath
XPath defines the route (or map) to the associated CustomXMLPart. By moussing over and clicking on the displayed XPath, you can copy it to the clipboard.
The remainder of the Advanced Mapping features are self-explanatory.
Global CC Tools
The Global CC Tools page provides utilities that you can use to perform selected functions on single, multiple or all content controls in a document at the same time.
In the discussion to this point, I've added and mapped five plain text content controls using either Basic or Advanced Mapping tools. The following illustrates the Global CC Tools page listing these five content controls.
Note: Version 1.1 adds the ability to suppress content control placeholder text when printing. The Flag Mapped and Unflag Mapped features in the Utilities group have been removed in Version 2.2.
When the page is displayed, all content controls in the document are listed alphabetically by title and selected in the list.
The 'Review - Title - Auto Title Utility' was introduced with version 3.0. It is adapted from a similar utility fully described in my Extract Data from Forms tips page.
You can use the other command buttons under the list to revise the selection or select/de-select individual controls using the mouse.
Using the controls in the 'Properties' or 'Utilities' section, you can quickly set/reset properties or perform utilities on all content controls selected in the list.
Properties
Provides global tools for applying properties common to most types of content controls.
While it is a good practice to set properties when you create your content controls, it can be time consuming and sometimes be frustrating when you need to later edit those properties.
For example, assume that for the purpose of illustration, you have a document containing 100 content controls, each with the 'Content control cannot be deleted' property set. Now you find that you need to relocate (cut and paste) a large segment of that document. You select the text and find to your chagrin that the 'Cut' command on the ribbon home tab is disabled! In frustration you might pound the 'Del' key only to have Word inform you that the 'The modification is not allowed because the selection is locked!'
Rather than spending the several minutes it would take to select and remove the property from the content controls in the selection, you can use Global Tools to remove the property from all content controls, relocate the text, then use Global Tools to reapply the property.
Note: Some properties listed are not applicable to all content controls (e.g., Allow carriage returns (multiple paragraphs) is only applicable to plain text content controls).
Each available property has three options. You can either apply the property, reset (clear) the property, or ignore (N/A) the property and leave it unchanged.
Utilities
With the utility tools, you can:
- Unmap selected mapped content controls.
- Convert selected content controls to text.
- Delete selected content controls and content.
- Add or remove shading to content control contents.
- Clear content control contents.
- Apply restricted editing 'editable' regions.
- Remove restricted editing 'editable' regions.
Unmapping a content control breaks the link between the content control and associated CustomXMLNode.
Note: Unmapping does not delete the CustomXMLNode or otherwise affect the mapping CustomXMLPart. To delete an unused node, use the Advanced Mapping tools.
Applying 'editors' and making content controls editable regions in documents with restricted editing 'No changes (read only)' provides an excellent and superior alternative to legacy formfields and protected documents when creating forms. See: Content Control Fill-In Form
Suppress Printing Placeholder Text
Select this checkbox to suppress printing any visible content control placeholder text in the document. You do not need to click the 'Execute' button after checking or unchecking this feature.
Note: Suppressing content control placeholder text (PHT) is a extremely fickle and imperfect process. For more on this topic see my 'Content Controls - Do Not Print Placeholder Text' tips page.
Single CC Data Tools
The Single CC DataTools page provides a convenient place to view information and set properties on a single selected content control. This eliminates the chore of locating individual controls in the document and repeating the steps to open the properties dialog.
Simply select the listed content control that you want to reviewedit. The list contains each content control in the document listed by title and sorted alphabetically.
Using the Single CC DataTools page you can:
- Click a listed content control to select it in the document.
- Viewchange applicable properties for the selected control.
- View data associated with the selected control.
In the illustration below, I've added a new untitled Combo Box type content control to my document and selected it in the list.
Notice the property controls have been reconfigured according to the type of content control selected.
For dropdown list and combo box type content controls, I can edit/modify the list members by clicking the list count data label or by using a predefined list from an external Excel spreadsheet, Word document, or comma separated values .txt file.
Clicking the list data label displays the built-in properties dialog. Use it in the normal way to edit or add items to the list.
Clicking 'Fill From List' displays a file picker dialog. Using this dialog, navigate to and select the file containing the list.
Note: When populating a list by using either the built-in dialog or an external list, it is important to remember that each list member has two parts. The first part 'Display Name' is the value you want to see displayed in the document when the list member is selected. The other part 'Value' is the data that is stored in an associated CustomXMLNode when the content control is mapped. Typically 'Display Name' and 'Value' are the same but they don't have to be. You must also ensure the each item in your list is a unique item and not repeated elsewhere in the list.
When using a predefined list, ensure the following:
- If using a Word document, ensure the document contains a single two column table. Define the list members 'Display Name' in column 1 starting with row 2. Define the associated list member 'Value' in column 2 starting with row 2. Defining column headings in row 1 is optional.
- If using an Excel spreadsheet, define the list members 'Display Name' in column A starting with row 2. Define the associated list member 'Value' in column B starting with row 2. Defining headings in row 1 is optional.
- If using comma separated text in a .txt file, ensure the comma separated text is contained in a single paragraph. Define each list member 'Display Name' as single strings of text separated with a comma.
Note: If using comma separated values, the values define both the 'Display name' and the 'Value.'
Pre-defined List Word format
Pre-defined List Excel Format
Pre-defined List (Comma Separated Values) .txt format file
With the exception of tools involving a command button (e.g., 'Fill Form List' and 'Set' etc.), most actions performed on this page occur instantaneously in real time (i.e., the content control title changes as you type in the title text box).
InstaMap©
Last but not least is the InstaMap© page. InstaMap© is, in my opinion, the crown jewel of the template add-in and can provide a single click mapping solution for most document layouts.
InstaMap© was designed primarily for use in mature documentstemplates which already contain qualified/properly titled or taggged content controls. The following illustrates a mature (nearly complete) template.
The template was prepared using Word 2013 and contains fourteen qualified content controls. I have used the Word 2013 content control property 'Show As' to display the controls with StartEnd tags so you can see that each control has a valid title.
No attempt to map the content controls using the tools already discussed or by any other method has been made.
Processing this document with InstaMap© results in the following:
Note: The query and 'Yes/No' option related to flagging mapped content controls was removed with version 2.2.
Notice InstaMap© automatically mapped all 14 qualified content controls in the document.
Now let's look at the CustomXMLPart used for mapping by switching to the Advanced Mapping page.
Notice that the same CustomXMLPart (Namespace: http://TheAnchorage/XMLPart) that is used by the Basic and Advance Mapping tools is used.
Note: When InstaMap© is used to create the CustomXMLPart 'CC_Mapping_Part' it does not create the default mapping nodes seen previously.
Option By Title/By Tag
With version 4.1 and later, InstaMap facilitates mapping document content controls by tilte or tag with the default by tag. This feature allows you to map content controls with a visible title displayed in the document content control tab. Naming conventions for content control tags are the same a described previously for titles.
Namespace and Default Namespace
Disabled in the website download version of the add-in. Premium (paid users) may define there own namespace and set it as default.
Link Like Titled Controls Option
The CustomXMLPart contains only nine (9) mapping nodes. This is because the InstsMap option to 'Link Like Titled Controls' was used so all instances of like titled content controls are mapped to a single common node. This links like titled content controls such that data entered in one control is repeated in the other like titled controls.
Note: Uncheck 'Link Like Titled Controls' on the InstaMap© tab page if you want each content control regardless of title to be mapped to its own unique data node.
Exclude Built-in Controls Option
In certain documents, the document creator may have used one or more document properties (e.g., Author, Company, etc.). These document properties are actually content controls mapped to one of the three CustomXMLParts built-in it every Word document. In most cases you will want to ensure this option is checked to preserve the existing mapping. Unchecking this open will result in the content control being unmapped from the built-in CustomXMLPart and remapped to the new CustomXMLPart used by Instamap.
Add Editors
With this feature checked, all mapped content controls in the main text section of the document only are configured as editable regions in document with 'Editing restrictions - No changed (Read only).
Miscellaneous
When InstaMap© is used in documents with untitled content controls or expanded repeating section content controls, or when previous mapping using CC_Mapping_Part has already been performed, the sequence of observed events may be different.
If previous mapping using the 'CC_Mapping_Part' has already been performed, initiating the InstaMap process will result in the following display. There is really no point in preserving the existing map so 'Yes' is always the recommend action.
If an otherwise qualified, but untitled content control is encountered during the InstaMap process, you are prompted to provide a valid title. You can provide a valid title or elect to skip mapping the untitled control.
If a repeating section content control is encountered that is expanded (i.e., contains more than the default single section), that repeating section control and all nested content controls it contains will be skipped and not mapped.
Utilities
Legacy Tool For Word On A Mac
The Utilities page tab was introduced with version 3.0 and expanded with versions 3.1, 3.4 and 3.5. It provides docking space for launching auxiliary utilities.
Formfield and ActiveX Conversion Utilities
Legacy Tool For Word On A Page
The 'Convert Formfields to Content Controls utility is described in detail in my Extract Data from Forms tips page. It and the Convert ActiveX controls are similar in form and function.
Bookmark Conversion Utility
Inspired by a burst of interest in content controls by my old friend Graham Mayor, I decided to include my take on a couple of utilities that he has created for his content controls add-in. Unlike formfields and ActiveX controls, bookmarks can exist as a single point (zero-width) in a document, one or more bookmarks can be nested within other bookmarks and bookmarks can overlap each other. The following depicts a relatively complex bookmark arrangement.
Unlike the previous two utilities described, only selected bookmarks are converted using the bookmark conversion utility. This permits the user to choose which bookmarks to convert. In cases of overlapping bookmarks, it is impossible to control with code which bookmark in a pair of overlapping bookmarks to convert. For the sake of this discussion, in this case we will excluded the overlapping 'red' bookmark.
Found Text Conversion Utility
Again inspired by Graham, this utility enables you to replace each occurrence of selected 'find text definitions' found in the current document with a content control. The find text definitions are user defined and stored in one or more external text (.ini format) files. On first use, the following sequence of dialogs are displayed and the first action is to create a find text definitions file and the first find text definition.
Find Text Definition Attributes
Each find text definition consists of the following twelve attributes in this order:
- Find string. This can be literal text, wildcard pattern or combination of literal text and wildcards.
- Allow wildcards. A Boolean value 0 or -1True or False
- Find whole word. A Boolean value 0 or -1True or False
- Match case. A Boolean value 0 or -1True or False
- Ttitle - Literal text defined by user or the found text.
- Tag - Literal text defined by user, matching literal text of defined title, or the found text
- Use found text as title - A Boolean value 0 or -1True or False
- Match tag to title - A Boolean value 0 or -1True or False
- Lock Content Control - A Boolean value 0 or -1True or False
- Lock content - A Boolean value 0 to -1
- Allow multiple paragraphs in plain text controls - A Boolean value 0 or -1True or False
- Placeholder Text (PHT) - Literal text defined by user, application default PHT or a zero-width string if field left blank.
Only the 'Find string' attribute is normally visible in the find text definition list. The list horizontal scroll bar can be use to review the other attributes or simply select the definition and click 'Edit.'
Global Attributes
The utility employs two global attributes:
- Index duplicated titles - Appends a underscore '_' and sequential index number to each content control created.
- Rich Text - Overrides default process and ensures that each content control created is a rich text type.
More information information on the attributes and there use is included in the add-in infohelp dialogs.
Mass Redefine Properties Utility
With the Mass Redefine Properties utility, you can select a 'pattern' content control in your document and apply the selected controls properties to multiple other controls in the document. The infohelp dialogs provide additional usage information.
Mapping Rich Text Content Controls Containing Tables
Mapping rich text content controls containing existing tables (or any content for that matter) is impossible using Words native XML Mapping Pane. I found mapping existing rich text content a perplexing problem in both the Advanced Mapping and InstaMap processes of the add-in. A particularly challenge was faithfully mapping rich text content when the content control contains a table at/near the content control end range. The following illustrates three cases:
The following shows the result of some earlier processing attempts with these cases. As you will see, something was clearly amiss.
The problem is related to how Microsoft goofed up defining the content control range boundaries. When processing rich text content controls containing tables, the add-in accommodates this condition. After processing, content controls meeting case 2 or case 3 conditions may include a blank single space and paragraph following the table in the content control range. Thanks Paul Edstein for your assistance with this issue.
ConclusionCredits
When Microsoft deprecated the standard TreeView control with the release of the Office 64 bit suite, I thought that the 'Advanced Mapping' tools page of the add-in was doomed to the dust bin of history. Without that control I was at a loss as to how to provide and display the XML structure of the CustomXMLParts.
To my pleasant surprise, Jan Karel Pieterse (JKP Application Development Services) assisted by Peter Thornton produced an enhanced a custom TreeView class which, with some assistance by Peter, I have substituted for the standard treeveiw control. It works masterfully and is available here: http://www.jkp-ads.com/Articles/treeview.asp
A special thanks to Peter for his work on the control and his assistance implementing it in this project. I would also like to thank Jay Freedman and Graham Mayor for their reviews and comments.
That's it! I hope you have found this tips page informative and find the add-in useful. You can download the template add-in here: Content Control Tools
For more on template add-ins and how to load them, see: Organizing Your Macros/Template Add-ins at: Installing Macros
PAYMENTS/DONATIONS
Do you want to make a payment for consulting work or donate to help support this site?
PayPal is a safe, easy way to pay online.
Use the appropriate currency 'Donate' button to make a payment or donation.
Search my site or the web using Google Search Engine
How to add a Legacy Text field in Word?
Step 1:
On the Word Ribbon, under tab Developer, click icon Legacy Tools (or press ALT+ L, N). A drop-down menu appears.
Step 2:
From the drop-down menu, under section Legacy Form, click the Text Form Field icon (or press ALT+L, N, E). Word creates a shaded text field at the cursor position.
Step3:
You can change the properties of the text field in the design mode. To switch to design mode, click the Design Mode icon (or press ALT+L, DM).
Step 4:
Double-click the text field in the document. Word displays the Words Form Field Options dialog box, where you can select the text field Type (regular text, number, date, current date, etc.), maximum length of the field, etc. Then click OK.
Step 5:
Protect the document: To be able enter data in the legacy text field, you need to protect the Word document. To protect a document, follow the steps stated below:
- Under the Developer tab, click icon Protect Document under the group Protect. A drop-down menu appears.
- Select option Restrict Formatting and Editing from drop-down. A pane appears on the right hand side.
- On the pane under the heading Editing Restrictions, select the checkbox (Allow only this type of editing in the document) and select option Filling in Forms from the drop-down list below.
- Click button Yes, Start Enforcing Protection.
- Set a password. You are ready to use the text field.
Note: Please note that the button Yes, Start Enforcing Protection will not be activated unless you disable the Design Mode option.
How to add an ActiveX control Text field in Word?
Step 1:
On the Word Ribbon, under tab Developer, click icon Legacy Tools (or press ALT+ L, N). A drop-down menu appears.
Step 2:
From drop-down menu, under section ActiveX Controls, click the Text Box (ActiveX Control) icon (or press ALT+L, N, T). Word creates a text box field at the cursor position. By default, the text box is opened in the design mode.
Step 4:
To change the properties of the text box, select the text box and then click Properties (ALT+L, L). The Properties sheet appears. Here, you can edit properties such as MaxLength, Caption, Font, etc.
To be able to enter data in the text box, you have to disable the Design Mode (ALT+L, DM)
Protect the document:
Finally, you need to protect the document before you publish the document to capture information using the text box fields. To protect the document:
- Under the Developer tab, click icon Protect Document under the group Protect. A drop-down menu appears.
- Select option Restrict Formatting and Editing from drop-down. A pane appears on the right hand side.
- On the pane under the heading Editing Restrictions, select the checkbox (Allow only this type of editing in the document) and select option Filling in Forms from the drop-down list below.
- Click button Yes, Start Enforcing Protection.
Note: Please note that the button Yes, Start Enforcing Protection would not be activated unless you disable the Design Mode (or press ALT+L, DM)
Also see: