Access.2007.VBA.Bibl..

(John Hannent) #1

I


f you need to produce documents with more sophisticated formatting
than is available in an Access report, your best option is to create Word
documents and fill them with data from Access. There are many ways to
export data from Access to Word; which one to use depends on the circum-
stances, the type of data to export, and user preferences. This chapter dis-
cusses the various types of Word documents you can create and the methods
you can use to fill them with data, with basic examples.

For more complex and realistic examples of exporting
Access data to Word documents, see Chapters 6 and 12.

The sample database for this chapter is Access to
Word.accdb.

Filling Word Documents with Access Data Using the TypeText Method ..............................


You can create a blank Word document (based on the default Word tem-
plate) with two lines of code:

Set appWord = GetObject(, “Word.Application”)
Set doc = appWord.Documents.Add

NOTENOTE


CROCROSSSS-REF-REF


IN THIS CHAPTER


Word documents and templates

Working with Word bookmarks

Working with the TypeText
method

Working with Word document
properties

Working with form fields

Working with tables

Creating Word Documents


from Access

Free download pdf