Microsoft Office Tutorials and References
In Depth Information
Mail Merge: Creating a One-to-Many List
End If¶
'If there is no target, then¶
'don't try to insert the table¶
If Doc.Bookmarks.Exists(BookmarkName) Then¶
'Variable declaration¶
Dim idfield As String¶
Set bkm = Doc.Bookmarks(BookmarkName)¶
idfield = rs.Fields(0).Name¶
'Create and format table¶
InsertList bkm, rs, idfield, _¶
Doc.MailMerge.DataSource.DataFields(idfield).Value¶
DoEvents¶
Cancel = False¶
Else¶
MsgBox "The bookmark " & BookmarkName & "is missing."¶
Cancel = True¶
Exit Sub¶
End If¶
End Sub¶
Wrd
Follow these steps:
1. Locate the 'Setup' procedure in the standard module. Change the
information pertinent to the operating system and mail merge that
needs to be specified as follows:
BookmarkName Name of the bookmark where the list should be
inserted
¾
DatabasePath
Full path to the database holding the list
(This does not have to be the same database or
application containing the data for the mail
merge.)
¾
TableName
Name of the table or query with the list data
¾
FieldNames():
Array of the field names with the list data
a. Type each field name in between a pair of
"quotes".
b. Separate each field name from the next using
a comma.
¾
c.
The very first field name must be the field
that links the mail merge records with the
data list information. Most often, this is an
Search JabSto ::




Custom Search