C
Craig
The code below has worked for years until my client updated their software to
2007. Now the mail merge part is broken. Any ideas?
Set myWord = New Word.Application
myWord.Visible = True
'Start a new main document for the mail merge.
Set myDoc = myWord.Documents.Open(sFileName)
With myDoc.MailMerge
.MainDocumentType = wdFormLetters
'Set up the mail merge data source.
sDBPath = CurrentProject.FullName
.OpenDataSource Name:=sDBPath, SQLStatement:="SELECT * FROM
[qryThankYou]"
.Destination = wdSendToNewDocument
.Execute Pause:=False
End With
myDoc.Close
2007. Now the mail merge part is broken. Any ideas?
Set myWord = New Word.Application
myWord.Visible = True
'Start a new main document for the mail merge.
Set myDoc = myWord.Documents.Open(sFileName)
With myDoc.MailMerge
.MainDocumentType = wdFormLetters
'Set up the mail merge data source.
sDBPath = CurrentProject.FullName
.OpenDataSource Name:=sDBPath, SQLStatement:="SELECT * FROM
[qryThankYou]"
.Destination = wdSendToNewDocument
.Execute Pause:=False
End With
myDoc.Close