Elsewhere on this web site there are batch processes to perform a number of tasks on a range of documents. The add-in featured here below is intended to cover those processes that have hitherto not been included.
The original version of the add-in was inspired by an add-in from my old friend Greg Maxey, to which it bore only a superficial resemblance; however as so often happens when we share ideas, he wanted to get involved in the further development, so from Version 2,0 the add-in is a collaborative effort.
The version you see illustrated below is functionally similar to Greg's version, though the branding reflects our individual tastes with links to resources on our own sites.
As with all the add-ins from this site, it is presented as a Word template and is supplied in zipped format complete with installation instructions. When installed it will add a tab and a pair of buttons to the Word ribbon as shown below :
One of the processes, pre-configured in the add-in template, employs a table stored in the body of the document 'Find and Replace Pairs Table.docx' included in the zip file, and which may be accessed by opening the template for editing in Word. This document is normally stored in the user's documents folder,
The table is intended to be editable, providing user-configurable find and replace pairs of words or phrases. The table header row is ignored when processing the documents.
Entries included in the table must conform to Word's find and replace rules and, where the option is selected, the use of wildcards - See the dedicated page on the subject of Using Wildcards in Word's Find and Replace dialog.
The add-in is intended for use with Word compatible documents and templates and is error trapped against inappropriate use.
This dialog allows documents in a selected folder (and optionally its sub-folders) to be processed, with one of a range of built-in processes. Where the active document has content, the add-in also offers the option to process that document (shown unavailable in the above illustration).
This function converts { DATE } fields to { CREATEDATE } fields retaining any formatting switch that may be applied or adding a switch from a large selection of date formatting switches, when no original switch is present. The original switch thus takes precedence over the selected date format.
Where { DATE } fields are locked against updating, they are not converted.
Historically Word has also used the { TIME } field to display the system date from the PC, therefore the 'Convert dates' function also converts { TIME } fields to { CREATEDATE } fields. However in the case of { TIME } fields, the fields are only converted where there is a date formatting switch present and when the field is not locked against updating.
The option provides a function to find and replace one word or text with another where-ever they happen to be in the documents. The process includes an option to search for whole words only and/or the use of wildcards - see Replace using wildcards.
Whereas the previous option provides for a single pair of words or phrases, the table option enables multiple searches to be performed on the same document. The table containing the pairs of words or phrases are stored in a document 'Find and Replace Pairs Table.docx' supplied with the add-in and may be accessed by opening the document in Word.
With regard to the three cells at the right hand end of the table (illustrated above). Enter Y in the WC column to indicate the use of a wildcard search. The code uses only the first letter to indicate whether to employ a wildcard search, so 'Yes' or 'yes' would be equally valid.
If wildcard is not used, enter 'Y' in the match whole word column 'WWO' to process whole word only.
Note: When a wildcard is used for a defined pair, match whole word is ignored
To omit the search pair from the process, enter 'Y' in the 'Omit' column. Thus the same table can be used for a variety of replacements.
The table can be edited directly from the option by clicking the 'Edit Table' button. This will open the table document for editing and close the userform.
This works in essentially the same way as the previous 'Find and replace with table defined pairs' option, however in this case the found text is replaced with the formatted content of the second column of the table. This can be any legitimate format that can be applied to the text, and could, for example, include an in-line graphic.
Uses the PDF creation function built into Word to save a batch of documents in PDF format. This function is not available for single documents as it is easier to simply save the document from Word.
This function is not available for single documents as it is easier to simply print the document from Word to the PDFCreator driver.
When converting to PDF format with PDFCreator the add-in additionally provides the option to engage PDF security measures. When the 'Continue' button on the main dialog is clicked, a second userform will open to offer that facility. Clicking 'Cancel' on this userform will cancel the whole process.
The items shown disabled in the following illustration become available when a Master Password is entered. If you don't want additional security measures then don't set a Master Password!
Currently the additional security options are only supported when the option PDF is checked. Should you check one of the other PDF format types, the dialog changes as shown below and any security settings entered are returned to their default values.
If you enter a Master Password and continue without setting options, you will see the following dialog. Click 'No' to set options or 'Yes' to continue without.
The PDF files are created in the same folder as the documents.
The add-in provides processes to convert straight quotes to English/US pattern smart quotes and vice versa. Note that international smart quotes are not provided for.
This option provides for the addition of a common password to open the processed documents, with optionally the facility to add a password to modify the documents:
This option can be used to replace an existing password. If the 'Require password' check box is checked (see next illustration) documents that are password protected may be processed, and this option will ensure that the password dialog is presented.
This option provides for the removal of common passwords from the processed documents
This option allows users to remove personal information from the document's metadata before publishing the document. The process also optionally offers the options to 'Accept All Tracked Changes' and to 'Remove Comments'. When the 'Remove Comments' check box is left unchecked, the comments are anonymised.
This option for experienced users with some VBA programming knowledge, allows the running of a user configured macro.
The 'User Defined Process' option allows users with VBA experience to define and execute their own processing procedures. "The procedure must be a 'Function' of a boolean variable type, defined in a standard module located in the user's 'Normal' template.
It must include a document object variable as a single parameter, and a basic error handler.. e.g.
Function MacroName(oDoc as Document) As Boolean
or
Function MacroName(ByRef oDoc As Word.Document) As Boolean
A sample of the basic structure required is shown in the first macro code panel below:
For a real world example you may wish to use the process to replace a company logo, or to add text to the document etc. e.g. The example shown below will change an autotext field in the header (first page header only if appropriate) from "MyLogo" to "MyNewLogo":
To run the macro from the batch process add-in, enter "ChangeLogoBuildingBlock" in the dialog macro name text box:
The add-in will accommodate documents and templates which are password protected against opening, modification, and in the case of protected forms against editing by checking the 'Require password' check box and entering the common passwords for the documents in the password dialog.
Documents for which a password is missing or incorrect are not processed but logged for later reference.
Where the add-in is processing multiple documents from a folder or a folder and its sub folders, progress indicators provide information about the current status:
When all is done, any unprocessed files are logged by name, with their paths, in a document which is left on screen. This document is unsaved and can be disposed of when the information it contains has been assimilated.
It is a common requirement for users to wish to apply similar information to a number of documents.
The add-in featured on this page will allow you to run a variety of processes, some built-in, others of your own design, on the currently active document, or on a folder containing documents, and, if required, any sub folders of that folder.
Some illustrations may not reflect the latest version number. The dialogs they contain are however similar to the latest version.