shuttlelaunch
Technical User
Hello All,
I am trying to make a command button in Access that will fill a Word Mail Merge with information from that record set. The code I have so far is:
The code works so far, but imports all the entries in the database, not the specific recordset being viewed.
Thanks!
I am trying to make a command button in Access that will fill a Word Mail Merge with information from that record set. The code I have so far is:
Code:
Set objWord = GetObject("C:\My documents\Mail Merge.docx", "Word.Document")
objWord.Application.Visible = True
objWord.MailMerge.OpenDataSource _
Name:="C:\my documents\Names Database.accdb", _
LinkToSource:=True, _
Connection:="Members"
objWord.MailMerge.Destination = wdSendToNewDocument
objWord.MailMerge.Execute
objWord.Application.Options.PrintBackground = False
objWord.Application.ActiveDocument.PrintPreview
The code works so far, but imports all the entries in the database, not the specific recordset being viewed.
Thanks!