Resting Anchor

The Anchorage

Personal website of Gregory K. Maxey, Commander USN (Retired)

Mayor & Maxey "CC/V/BM & DP Tools" Add-In
(A Microsoft Word Help & Tip page by Gregory K. Maxey)

DISCLAIMER/TERMS OF USE

The information, illustrations and code contained in my "Microsoft Word Tips" are provided free and without risk or obligation.

Click to acces PayPal Verification Service Click to acces PayPal Verification Service

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!


This Microsoft Word Tips & Microsoft Word Help page introduces the Mayor & Maxey "Content Control/Variable/Bookmark & Document Property Tools" Word template add-in. The add-in is the culmination of a colossal collaborative effort longtime friend and Word MVP Graham Mayor.  

Background

The impetus for this project is the lack of visibility and everyday user access to two very useful and powerful Word features; the "document variable" and the "mapped" content control.

The add-in makes our previously released "Document Variables, Bookmarks & Properties" Add-In obsolete. It also makes my previously released "Mapped Content Controls" obsolete.

While users can easily insert references to an existing document variable using a Word "DocVariable" field, Word does not provide a convenient method for managing document variables or the data they store. Until now, for many users, they remained "Hidden Gems in Word." Variables can be used to store and exchange all manner of information for use in a document. Using the add-in you can easily manage and incorporate document variables in your document design and more fully utilize the power of Word.

Content controls were introduced in Word 2007. Since their introduction, their real usefulness as windows and conduits to data in an XML file is limited to a set of advanced Word users familiar with both Visual Basic programming and XML data structure. Now using the add-in even beginner users can quickly and effortlessly create and use all varieties of mapped content controls.

We have retained the features for working with bookmarks and document properties introduce in our earlier "Document Variables, Bookmarks & Properties" add-in. This results in a single compact and versatile add-in for working with all five principal data storage collections in your documents.

Add-In Description

The following illustrations and descriptions are provided to help you make the most of the add-in.

Site Note IconNotes:
    1. Testing and development with this add-in has been limited to the U.S. English version of Microsoft Word 2007/2010 in a Windows7 operating environment and the U.K. English version of Microsoft Word 2007/2010 in a WindowsXP operating environment. Lack of access, time and resources has prevented further testing. Unfortunately feedback confirms that the variances in other language versions of the Microsoft products involved can prevent the add-in from functioning properly in those versions.

    2. With any large development work changes are inevitable. While the illustrations were current with the release of version 1.1, there may be future changes that are not fully or accurately illustrated.

mm addin 1
Add-In ribbon user interface

When the add-in loads it alters the Ribbon as follows:

  1. The user interface propagates on the Ribbon "Add-Ins" tab.

Site Note IconNote: Word templates add-ins can be loaded manually from any template storage directory or automatically from your Word startup folder. For more on template add-ins and how to load them, see the heading: Organizing Your Macros/Template Add-ins at: Installing Macros

  1. Creates a new custom group "M & M Add-In."
  2. Adds a new large button control "CC/V/B & DP Tools." This initiates the primary add-in userform interface.
  3. Adds a new normal button control "Options." This control displays options for the user to select when using the add-in.
  4. Adds a new normal button control "Info/Help." This control links to the add-in information web page.
  5. Add as new normal button control "Disclaimer." This control displays a disclaimer statement releasing the developers from any liability or obligation associated with use of the add-in.

Clicking the add-in "Options" ribbon command button displays the add-in "Options" dialog:

mm addin 2
Add-in "Options" dialog
  1. Adds a single large button control to the Word ribbon user interface "Insert" tab.
  2. Provides feedback with sound.
  3. List bookmarks and content controls sorted by their location in the document.

Site Note IconNote: The location sort is based on the items location in the various document story ranges starting with the main text range, then footnote range, followed by end note range etc., and not how the item might physically appear in the document.

  1. Accepts user options and stores the selected values in the add-in dedicated registry key.

Site Note IconNote: All options are initially enabled by default.

Add-in "Insert: tab control:

mm addin 3
Add-in "Insert" tab control
  1. Optional display. Activates the primary add-in userform interface in the document.

Site Note IconNotes:
    1. This feature may effect the normally displayed size of the built-in "Hyperlink, Bookmark and Cross-Reference" controls. These controls will display size "normal" when displayed with the add-in button control regardless of how they might display (i.e., large or normal) on their own.

    2. This feature was also the single biggest point of contention between Graham and I during development. He wanted the controls on the Insert tab and I felt they belonged on the Add-Ins tab. The result is our form of compromise.

Add-In common elements and "Lists" tab page:

mm addin 4

The add-in consists of a three part multi-page control and common elements. The functions of the common elements and "Lists" tab page is described below:

  1. Provides the name and version number of the add-in.
  2. Three tabs across the top of the Add-In provide the user with access to the three main functions of the Add-In.
  1. Allows users to select one of five featured document collections.
  2. Displays a "collection list" that lists each member of the selected collection in the document. Bookmark and Content Controls can be listed by location or alphabetically using the add-in options feature. The Variables, Custom Document Properties and Built-in Document Properties (shown) collections are only listed alphabetically.
  3. Manually refreshes the collection list. Use this feature if you perform other work in the document with the add-in active and you make changes in the document that would affect information displayed.
  4. Relocates the document selection to the bookmark or content control selected in the collection list.
  5. Inserts the appropriate cross reference field (REF, DocVariable or DocProperty) to the bookmark, variable, or document property at the selection in the document.
  6. Inserts a new content control at the selection in the document. The new content control inherits properties of the content control selected in the collection list. Both controls are mapped to the same XML data node.
  7. Initiates a delete action on the item selected in the collection list. Reconfigures the User Notification and Action Panel to provide additional user options and controls.
  8. Changes the value of the item selected in the collection list to a user entered new value in the "Content/Value" field.

Site Note IconNote: Values in certain Built-in Document Properties are calculated values and cannot be changed.

  1. Displays the value of the item selected in the collection list. When enable, the user and modify the data and use the "Change Value" control to safe and store the new value.
  2. Link to support and information web page.
  3. Multi-purpose "User Notification and Action Panel."
  1. Displays the namespace of the document custom XML data store that is used for content control data mapping.
  2. Closes the Add-In.

Site Note IconNote - One or more command button or other control will be disabled depending on which collection option is selected.

The "User Notification and Action Panel" depicted below is is shown configured to delete the selected bookmark:

mm addin 5
  1. Multi-purpose "User Notification and Action Panel" configured to delete the bookmark "Defendant" selected in the collection list. The configuration is initiated by selecting an item in the collection list and clicking the "Delete" command.
  2. Notification of action initiated additional options.
  3. When selected this option will unlink all document fields cross referenced to the selected item and convert the field result to fixed text.
  4. When selected this option will delete all document fields (and field results) cross referenced to the selected item.
  5. When checked the content of a selected bookmark or content controls is deleted with the bookmark or content control.
  6. Cancels the initiated "Delete" action.
  7. Executes an initiated "Delete" action.

"Create Variables, Custom Properties or Bookmarks" tab page:

mm addin 6

Using the "Create Variables, Custom Properties or Bookmarks" tab you can define and create new document variables, custom document properties or bookmarks.

  1. Enter a unique name for new variables you want to create.
  2. Enter the value you want to assign to the new variable.
  3. Create the new variable as defined.
  4. Use text selected in the document to define the new variable value.
  5. Select one of four data types for new custom document properties you want to create.
  6. Enter the unique name for new custom document properties you want to create.

Site Note IconNote: Word provides 35 pre-defined custom document properties (without values). This field is a combo box which allows you to choose from one of the pre-defined properties and assign a value or define your own new property name.

  1. Enter the value you want to assign to the new custom document property.

Site Note IconNote: Values for custom document properties are type dependent. For example, if you opt to create a "Date" type custom document property then the value you define must be in a valid recognizable date format.

  1. Create the new custom document property as defined.
  2. Use text selected in the document to define the new custom document property value.
  3. Bookmark the selection in the document. This feature employs Word's built-in bookmark dialog.
  4. After action add-in configuration. You can chose to remain on this page after each variable, custom document property or bookmark is created, or immediately return to the appropriate collection on the "Lists" page.
  5. "User Notification Panel" common to this page and the "Create/Manage Mapped Content Controls" tab page.

"Create/Manage Mapped Content Controls" tab common elements and "Create Mapped Content Controls" tab page:

mm addin 7

The "Create/Manage Mapped Content Controls" tab page consists of a two part multi-page and a common "User Notification Panel."

  1. The "Create Mapped Content Controls" tab page is used to define and map document content controls.
  2. Displays the second page of the two part multi-page "Delete Mapped Content Controls/Mapping Tools."
  3. Identifies the unique namespace used to identify and locate (or create) a document CustomXMLPart designated as the XML data store for content control mapping. You can define your own namespace or use the default namespace defined by the add-in.
  4. Provides additional information about namespaces.
  5. Select one of six content control types to define and map.

Site Note IconNotes:
    1. A mapped content control is a content control that is "bound" to a data node in a XML data store. If the data in the node is changed then the data displayed in the content control is updated to reflect the change. If the data in a mapped content control is changed (i.e., by you the user) the data in the node is updated and changed. By locating content controls in your document that are mapped to the same node you can enter data in any one of the like mapped controls and have it instantly updated and reflected in all like mapped controls.

    2. Rich text, group and building block gallery content controls cannot be mapped to a XML data node.

    3. Checkbox content controls were introduced in Word 2010 and are not available in Word 2007. See my: Content Control Checkboxes for tips on creating pseudo content control checkboxes in Word 2007. These pseudo checkboxes cannot be mapped.

  1. Defines and maps a content control that you have selected in the document.

Site Note IconNote: To select a content control in the document for mapping you must select the physical control (not just the control range). To select the physical control you select the control's title tab.

mm addin 8
  1. When working with templates you can create a building block from your mapped control. These building blocks are stored in the "Mapped Content Controls" category of the template's "Custom Quick Parts" gallery.
  2. Uses Word's built-in "Content Control Properties" dialog to define a title, tag, list entries and other built-in properties of your content control.

Site Note IconNotes:
    1. It is important that you define a unique title property to each content control that you create and map using this add-in. You should also assign a unique title property to any unmapped content control that you create using the controls in the Word Developer tab Controls group. Using duplicate titles, deleting titles or changing title property definitions of mapped content controls can effect the accuracy of the content control "Delete" processes used in this add-in.

    2. The "Define Control Properties" and "Content Control Properties" dialog actions creates, defines and inserts the new content control in the document and enables a "Placeholder Text" field (not shown) for "Text, Drop-Down List, Combo Box, and Date" controls with a pre-defined placeholder text entry and enables the "Map Control" command button. You can accept the pre-defined placeholder text or define your own.

  1. Maps the content control to a custom node in the designated document CustomXMLPart.

Site Note IconNote: You "MUST" initiate the "Map Control" command to compete the mapping process.

  1. Common "User Notification Panel."

"Delete Mapped Content Controls/Mapping Tools" page tab:

mm addin 9

Using the "Delete Mapped Content Controls/Mapping Tools" tab you can use several methods to remove unwanted mapped controls from your document and review/clean-up/delete the XLM data store.

Site Note IconNote - All delete actions initiated from this page tab override any "Content control cannot be edited", "Content control cannot be deleted" and unsecure (no password) document protection for forms.

  1. The "Select from List" frame lets you select mapped content controls to delete from a convenient list.
  2. Lists the title and number of like mapped content controls in your document.

Site Note IconNote: This is where unique title discipline mentioned earlier becomes important. When you insert a cross reference content control using this add-in or if you copy and paste a mapped content control in your document to another location in your document, you have created for all intent and purpose a clone. It is only logical that the clone will retain the title and XML mapping path. Should you later change title of a like mapped content control it will affect the accuracy of this list and the accuracy of the subsequent delete actions.

  1. You can opt to delete the control (leave the content), the content (restore placeholder text) or both.
  2. Executes the delete content controls action as defined.

Site Note IconNote: As this process deletes all mapped content controls sharing a common title the associated custom XML node is also deleted from the document CustomXMLPart.

  1. The "Selected in Document" frame lets you select a mapped content control to delete from within the document.
  2. You can opt to delete the selected control, the content of the selected control, both the selected control and content, like controls or like controls and content.

Site Note IconNote: By the nature of mapped controls if you delete the content in one the content is deleted from all like controls.

  1. See item 4. and the associated note above.
  2. The "All" frame lets you delete all mapped content controls from your document.
  3. You can opt to delete all mapped controls, the content of all mapped controls or both.
  4. Executes the delete all content controls action as defined.

Site Note IconNotes:
    1. This action effects all document mapped contents and is irrevocable (except for immediately closing a document without saving changes). Therefore the developers have added a confirmation step. When the command button is initially selected a confirmation notification is displayed and the command button caption is displayed in red lettering. Clicking the command button displaying a red letter caption executes the event without additional notification or warning.

    2. As this process deletes all mapped content controls without regard to title the associated custom XML nodes are "not" deleted from the content control XML mapping node. You should review and clean-up/delete the associated CustomXMLPart after you delete all mapped controls using this method.

  1. Lists the namespace of the defined document CustomXMLPart designated for content control mapping and all other document CustomXMLParts containing a content control mapping node created using this add-in.
  2. Allows you to review and delete individual custom XML nodes associated with existing mapped content controls or the remnant nodes from mapped content controls subsequently deleted, an entire content control parent mapping node or entire CustomXMLParts that constitute the content control mapping part. Reconfigures the "User Notification Panel" for XML

Site Note IconNote: If you delete a content control directly in the document its mapping node remains as a remnant. If you undo the delete action the restored content control remains bound to remnant mapping node. When mapped controls are deleted using the "Select from List" or "Selected in Document" methods the associated mapping node is also deleted.

  1. Opens the selected document CustomXMLPart for viewing using "Notepad."

Site Note IconNote: The temporary XMLMapping.txt used for viewing is automatically deleted by the Add-In after use. If you want to retain the file you must save it using a different file name while Notepad is open.

  1. Dual purpose "User Notification and Action Panel"

"User Notification and Action Panel" configured for the "Delete XML Mapping" function:

mm addin 10
  1. The reconfigured "User Notification and Action Panel" displays four command buttons that you can use to review and clean-up your designated content control mapping node and information related to node content.
  2. The "Delete by Node" command button initiates a loop to display the value of each individual content control child node in the content control parent mapping node. The command button caption changes to "Next Node" after the loop is initiated (see illustration below).
mm addin 11
  1. The "Delete Node" command is activated when a single content control mapping node value is displayed. Clicking the activated command button deletes the node from the content control parent mapping node.
  2. Can display two captions. "Delete Map Part" (as shown) or "Delete Map Node." The caption displayed and function is dependent on the content control parent mapping node. If that node is the base (parent node) of the document CustomXMLPart define by the selected namespace the command button caption displays "Delete Map Part" and functions to delete the entire document CustomXMLPart. If that node is a child node of the base (parent node) of the document CustomXMLPart defined by the selected namespace the command button caption displays "Delete Map Node" and functions to delete the content control mapping node from the CustomXMLPart parent node.

Site Note IconNotes:
    1. For most user and in most applications dual functions of this command button will be immaterial. However, advanced users can feel confident that the add-in content control mapping functions can be integral part of a broader document CustomXMLPart.

    2. Deleting mapping nodes (selectively or in whole) breaks the link between the XML data store and associated content controls. It has no other effect on document content controls or the data they contain.

  1. Cancels all XML mapping delete functions and reconfigures the Add-In for other functions.

Alerts & Notifications

The "User Notification Panels" provide various alerts and notifications. The add-in alerts the user to restricted or invalid events using the "red" alert text in the appropriate "User Notification Panel" and an audible default system "Beep."  A typical alert notification is shown below:

mm addin 12

Several processes in the add-in require documents protected for forms to be temporarily unprotected to complete. When a password is required the user is presented with the following form:

mm addin 13

Site Note IconNote: These processes are performed automatically without any user interaction in unsecure (no password) protected forms.

Content Control Title Parsing

The Add-In will parse the document for untitled and duplicate titled (non-mapped) content controls each time it is initiated. As content controls are listed by title they must have either a title property or a temporary label in lieu of a title property. Careful and thoughtful application of content control titles will eliminate this notification.

mm addin 14

Site Note IconNote - It is intuitive and expected that like mapped content controls will have the same title.

That's it. I hope you find the Add-In helpful and as much fun to use as it was to create!! Download the add-in here: CC/V/BM & DP Tools Add-In

Site Note Icon Note: For more on template add-ins and how to load them, see the heading: Organizing Your Macros/Template Add-ins at: Installing Macros

I can't stress enough the encouragement and co-operation by Graham Mayor or the technical contributions he made. This add-in simply would not have been possible without him. Please visit Graham's web page for his slant on the add-in, its features and tips for installation at: Graham's Add-In Description.

PAYMENTS/DONATIONS

Click to acces PayPal Verification Service Click to acces PayPal Verification Service

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

Google Search Logo

Or

JustAnswerAsk a Word Expert OnlineSubmit