mikebrewer
Registered User.
- Local time
- Today, 04:49
- Joined
- Sep 28, 2011
- Messages
- 93
Hi all,
I'm trying to start a mail merge from Access to a pre-defined template in Word. I have the template built. Here is my code:
Set oWord = CreateObject("Word.Application")
Set oWdoc = oWord.Documents.Open(wdInputName)
' Start mail merge
'------------------------------------------------
With oWdoc.MailMerge
.MainDocumentType = 0 'wdFormLetters
.OpenDataSource _
Name:="C:\Folder\DB.accdb", _
AddToRecentFiles:=False, _
LinkToSource:=True, _
Connection:="TABLE myTable"
.Destination = 0 'wdSendToNewDocument
.Execute Pause:=False
End With
everything does fine until the merge starts and it prompts me to pick the table EVERY DAMN TIME. How can i get it to not ask me for the table. What am I missing?
I'm trying to start a mail merge from Access to a pre-defined template in Word. I have the template built. Here is my code:
Set oWord = CreateObject("Word.Application")
Set oWdoc = oWord.Documents.Open(wdInputName)
' Start mail merge
'------------------------------------------------
With oWdoc.MailMerge
.MainDocumentType = 0 'wdFormLetters
.OpenDataSource _
Name:="C:\Folder\DB.accdb", _
AddToRecentFiles:=False, _
LinkToSource:=True, _
Connection:="TABLE myTable"
.Destination = 0 'wdSendToNewDocument
.Execute Pause:=False
End With
everything does fine until the merge starts and it prompts me to pick the table EVERY DAMN TIME. How can i get it to not ask me for the table. What am I missing?