

Use a graphic program to create your image and footer image files.

Step 1: Create header and footer image files and place them in a folder called Images Scale the images to the appropriate magnification level by using scaling commands in the VBA code.Įach of these steps is detailed below.
#Microsoft word insert image in list code
Write VBA code to take the input from the user form box and place the appropriate image files at the correct bookmarks.Code a user form box to pull the office information from the source table and display that in a simple window as the template file opens.Set bookmarks in the template file to indicate where the images are to be placed in the document.Create a source Word document containing a table of the office location names and the names of the header and footer image files.Create your header and image files and place them in a folder called Images.The approach I used can be broken down into these major steps: Simply by having graphics provide refreshed image files the template would be updated through the dynamic use of the user form pulling in the new images. This way modification of the template could be done in-house by the graphics department. Thus, the solution was changed to using VBA to insert images of the header and footer information instead of using VBA to place textual information.

They didn’t want to have to modify the VBA code whenever they wanted tweaking done. But this working solution ran into issues with the client’s desire to have direct control over fine-tuning the exact placement of the text and its font characteristics such as size and boldness. This task was first solved by using Visual Basic (VBA) inside Microsoft Word to create a user form with controls that are mapped to specific bookmarks in the template. The end user selection then was to be used to populate specific office information such as address and phone numbers in the header and footer areas. When the file opened, they wanted a prompt to ask the end user which office they would like to create a letterhead document. A company that was rebranding approached me with the desire to create one universal letterhead template file that would work for all office locations.
