Hi All,
I have this older code(see below) that I used for a mailmerge in
another application, I'm looking to do something similar but a little
different in that, this time I have a single record to merge and after
the merge to the document I want to store it on a particular server in
a particular folder with a particular file name and I don't know what
the coding would be for that.
I assume it would go in place of the "objWord.MailMerge.Destination =
wdSendToPrinter" statement.
Can anyone tell me what the vba code would be?
thanks
bobh.
'start the mail merge process for creating filling in the word doc
Dim objWord As Word.Document
Set objWord = GetObject("\\HanClus\Corpshare\CommonDBs\ComunRat\ Docs
\FoundationChk.doc", "Word.Document")
'Make Word visible.
objWord.Application.Visible = True
'Set the mail merge data source as the database containing the mail
merge data.
objWord.MailMerge.OpenDataSource _
Name:="\\HanClus\Corpshare\CommonDBs\ComunRat\Apps
\CommRelationsFE.mdb", _
LinkToSource:=False, _
Connection:="Table tblDataForCReq", SQLStatement:="Select * from
[tblDataForCReq]"
'Execute the mail merge.
objWord.MailMerge.Destination = wdSendToPrinter
objWord.MailMerge.Execute
'close the Word application
objWord.Application.Quit
Set objWord = Nothing