Access.2007.VBA.Bibl..

(John Hannent) #1
Word is not running; open Word with CreateObject:

Set appWord = CreateObject(“Word.Application”)
Resume Next
Else
MsgBox “Error No: “ & Err.Number _
& “; Description: “ & Err.Description
Resume ErrorHandlerExit
End If

End Sub

Document Properties ................................................................................................


When you use Word document properties rather than bookmarks to write Access data to a Word
document, you don’t need to have two (or more) sets of bookmarks, one for each place you want
to display a piece of data (for example, displaying the recipient’s name and address on the letter
and the envelope). You can write the data to a document property once and display it in multiple
places in the Word document with DocProperty fields.

To create the properties, first select Finish from the File menu in the template, and select Properties,
as shown in Figure 2.7.

FIGURE 2.7

Opening the Document Information panel.


Creating Word Documents from Access 2

Free download pdf