Access.2007.VBA.Bibl..

(John Hannent) #1
Click the Custom tab to see the custom document properties; these are the ones that are most
commonly filled with data from Access fields. Figure 6.12 shows the Custom tab of a Word 2007
template properties sheet, with several custom document properties that are useful for creating let-
ters and other documents filled with data from an Access select query.

FIGURE 6.12

The Custom tab of the Word properties sheet.


You may also want to use some of the fields on the Summary tab (see Figure 6.13), in particular
the Keywords field, which is displayed in the Type column in the Windows Vista Explorer.

To create a new Word document property, enter its name in the Name field (no spaces, and you
should avoid using the same name as a built-in property, although Word allows this), select the
data type (Text, Numeric, Date, or Yes/No), enter a default value if desired, and click the Add but-
ton. Over years of working with Word document properties, I have discovered some limitations of
Word document properties and developed some workarounds to deal with them:

n If you don’t specify a default value for a Text property, Word won’t let you save it; instead,
use a space (which is permitted) as the default value.
n Date fields should generally be avoided, except for the rare cases where you actually need
a default date value, because there is no way to give them a blank default value. You can
format a Text value as a date, using Word field switches.

Working with Word Documents and Templates 6

Free download pdf