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.

Insert a batch of files into a Word document

 Boiler is a template add-in for Microsoft Word, originally conceived by Woody Leonard (with several modifications of my own) to include boilerplate text(s) into Word. It can be used to insert pre-prepared texts at the cursor - in much the same way that you would use autotext, autocorrect or includetext, or you can use it to combine a number of documents into one e.g. the separate chapters of a book. The documents can be selected from different folders (or in the case of the Word 2007-2016 version from file lists stored in Excel worksheets), and the dialog will display files from those folders with the extensions DOCX, DOC and TXT. Other files are excluded.

The zip file includes versions of the add-in for Word 97-2000, 2002-2003 and 2007-2016. The 2002-3 and 2007-13 versions also include an EXE format installer, which will place the appropriate template in the default Word startup folder. If you have changed the location of the startup folder from the install default, change the path to the new location from the installer dialog.

Word will attempt to load any file located in either location on start-up.

The folder location for the Word startup folder will vary with operating system and/or user. If you don't know the location on your machine, check Word > Tools > Options > File Locations.

If you have not changed the default location of the Word Startup folder, it can be located (in English language versions of Windows) by typing %appdata%\Microsoft\Word\STARTUP in the address bar of Windows Explorer or your Internet Explorer web/file browser (but not Firefox etc).

The installer when run will produce the following dialogs:

When correctly installed the add-in will be loaded with Word and will appear in the templates dialog. In Word up to 2003 this is located via Tools > Templates and add-ins. In Word 2007 and 2010 the Templates button is on the Developer tab of the ribbon. The dialogs for all Word versions are similar.

In the 2000 and 2002-3 versions, the add-in provides a Custom toolbar called 'Insert Files' which should be displayed by default, but if it isn’t select View > Toolbars and check the 'Insert Files' entry.

In Word 2007 and later, the Insert Documents command can be found in the Boiler group on the Insert tab of the ribbon.

Note that the illustrations below are from the Word 2007-2016 version. The earlier Word version add-ins do not have the full range of options that this version features, in particular the Excel option and the multiple file locations, but the principle is otherwise much the same.

Clicking the Insert Documents button in the 2007 - 2016 version from the first time produces the following configuration dialog. From that dialog you can select as many or as few folders as you wish for ease of recall later. The main dialog offers buttons for up to 8 folders. Each selected folder must be given a descriptive text, and the function is error trapped for missing texts. You may also select an Excel file containing a list of files, but more of that later.

Each of the folder buttons displays a dialog similar to that shown below from which you may select the file folder. The above dialog may be recalled at using the Config Folders button on the ribbon. The Reset button clears all the entries and returns to first use conditions.

In the Word 97/2000 version there is no Excel option and the following dialog is used instead.

Select the folder that contains the documents you wish to include and click ‘Open’ or ‘OK’ according to version.

This causes the following dialog box to be displayed (the Word 97-2000 version does not have all the options shown below).

The above dialog will appear each time the utility is run, however it can be hidden by clicking the check box at the bottom of the next screen

Excel workbooks for use with this function must have the default worksheet name 'Sheet1'. The first column must have a header in row 1 'Name' and the second column a header 'Path'.

By implication the first column should contain the filenames complete with their extensions, and the second column must contain the paths to the corresponding files in the first column.

The dialog only displays the filenames.

Inappropriate worksheet formats are trapped and an error message will be displayed.

Where the File option is chosen, the file browser will display all the files shown in the currently selected folder with the extensions DOC, DOCX and TXT. Word 2003 can only open DOCX when the Office 2007 compatibility pack has been installed. In the Word 2003 version, if a DOCX format file is selected, the user will be prompted with a warning

for the first such file. If you are certain that you have the required filter installed then you can ignore the message. Otherwise use the 'Remove' button to remove the inappropriate file from the list of files to be inserted. Continuing when the correct filter is not present will result in garbage and the likelihood of document corruption.

Because of the way Word formats documents, the function works best when all the inserted documents are based on the same template. There will inevitably be some formatting issues if the inserted documents use the same style names to produce different layouts.

To help minimise some of the issues that may occur, check the 'Insert each document on a new page' check box when inserting batches of documents. This inserts a new page section break between each document. Selecting this option provides two further options to enable that new page section break to be an odd or even page break.

It is not the perfect solution, but it is as good as you are likely to get when working with disparate document types.

If updating the Word 2007-2010 from a version older than Version 2.7, click the reset button on the ribbon, before updating, to remove the registry settings which are not used from version 2.7. Failure to do so will not cause any problems however. They will just be ignored.

- Click here to download the add-in

 

 

'Boiler'

Whilst preparing the 'Print a batch of files' page which draws much from the 'boiler' add-in that has been a downloadable file from this site for several years, I realised that I had not created a separate page referring to that add-in.

The downloadable file did include comprehensive description of the add-in and its use, but the reasons why I did not prepare a page to accompany it are lost in the mists of time. This page now corrects that omission.