Click the Add button

Go through those steps for each item of data that you want VBA to insert later. In the example shown in Figure 14-7, we add three bookmarks to the document. Note that the square brackets around each bookmark's name are visible because the Show Bookmarks option is enabled. We didn't type any of those square brackets.

bookmarks to later accept Access data.

Bookmarks bookmarks to later accept Access data.

Bookmarks

The bookmark names in the sample document template get data from Access and VBA as follows:

^ TodaysDate: VBA replaces this bookmark with the current date.

^ AddressLines: VBA replaces this line with as many lines as necessary to show the recipient's address.

^ Salutation: VBA replaces this with the customer's first name or just Sir or Madam if the first name is Null (empty) in the record being printed.

When you finish typing your document and all your bookmarks are in place, follow these steps to save the document as a Word template:

0 0

Post a comment