ErrorHandler:
If Err = 429 Then
‘Word is not running; open Word with CreateObject
Set appWord = CreateObject(Class:=”Word.Application”)
Resume Next
Else
MsgBox “Error No: “ & Err.Number _
& “; Description: “ & Err.Description
Resume ErrorHandlerExit
End If
End Function
Creating a Word Document Based on a Template ..........................................
The functions in this section (and later sections) pick up the Contact Templates folder path, and
the Contact Documents folder path, from the main menu. Each path has a command button and a
TextBox bound to a field in tblInfo; clicking the command button opens a FolderPicker dialog for
selecting the path. The selected path is displayed in the TextBox, as shown in Figure 6.6.
FIGURE 6.6
The main menu of the Word Export sample database.
If you click the Contact Templates Path or Contact Documents Path button, a Browse dialog opens,
where you can select the folder for storing templates or documents (see Figure 6.7).
The procedures that pop up these Browse dialogs are discussed in Chapter 9.
CROCROSSSS-REF-REF FIGURE 6.7
Working with Word Documents and Templates 6