The question is; "How can I setup the merge document to with merge field code
to import the access database table."
This my access code below.
Dim objWord As Word.Document
' Dim objWord As Object
Dim strDocName As String
Dim strDatabaseName As String
strDocName = CurrentProject.Path & "\MergeLetter.doc"
Set objWord = GetObject(strDocName, "Word.Document")
' Set objWord = GetObject("MergeLetter.doc", "Word.Document")
'
' Make Word visible.
objWord.Application.Visible = True
' Set the mail merge data source as the Northwind database.
objWord.MailMerge.OpenDataSource _
Name:=strDatabaseName, _
LinkToSource:=True, _
Connection:="QUERY qryFormletter"
'SQLStatement:="SELECT * FROM tblCustomerProfile"
' Execute the mail merge.
objWord.MailMerge.Execute
End Function