Graham Mayor

... helping to ease the lives of Microsoft Word users.

Many people access the material from this web site daily. Most just take what they want and run. That's OK, provided they are not selling on the material as their own; however if your productivity gains from the material you have used, a donation from the money you have saved would help to ensure the continued availability of this resource. Click the appropriate button above to access PayPal.

Change Word field formatting switch - Mergeformat/Charformat

Most fields inserted into Word documents are appended with a formatting switch by default.

Of course you can turn off this option on a per field basis, or you can display and manually edit the field after it has been inserted. Yet, in most instances, it is not necessary and you will not see any difference in the reproduced field results, whether the switch is present or not.

Occasionally, and especially when linking material from other documents, but formatted in the document, updating the field causes the field format to change back to that of the source material.

In the following example a link to an Excel worksheet is formatted with a distinctive style in the document:

but when the field in the document is updated, the inserted link reverts to the format of the source:

Adding a charformat switch to the field restores the format to that applied to the field:

To aid users to add and remove formatting switches, I have produced a simple add-in that removes the head scratching from the process. It adds (or removes) a switch and updates the field so that the change is instantly available to view.

Not all fields are compatible with such formatting switches. Therefore the add-in does not list such fields in the dialog and thus does not attempt to alter them.

The add-in, like all the add-ins in this site, is supplied as a template which should be saved in the Word startup folder. If you have not changed the preferred startup folder it can be located (in English language versions of Windows) by typing
%appdata%\Microsoft\Word\Startup
in the Windows File Explorer Address bar and pressing Enter.

A simple self extracting installer is also supplied in the zip. You may therefore install manually or automatically as is your preference ... when Word is closed.

The add-in places a button on the ribbon of the Developer tab. (The Developer tab may not be displayed by default, but can easily be added from Word's options).

Using the add-in

Clicking the button produces the following dialog, listing all the editable fields in the document.

The process is not intended for use with documents that have editing protection, such as protection for filling in forms and will warn the user to unprotect the form before use. The dialog also shows when there are no editable fields present, as in the first of the following two illustrations

Use the Select and Remove buttons to select the field types to be processed. You may select all types or as few as one. The process will only act on the selected field types. The default action is to remove any Mergeformat or Charformat switch from the fields, but you may choose to add Mergeformat or the more useful Charformat switch as required. Yoiu can make the changes repeatedly in the same document without affecting the integrity of the fields or any other switches that may be applied.

 

- Click here to download the add-in.

 

 

 Formatting switch

Formatting switches ate covered in some depth elsewhere on this site

This page concentrates on a user friendly add-in that allows the formatting switches 'Charformat' and 'Mergeformat' to be added, changed or removed, selectively by field type.