Hi All,
I'm trying to get this(see below) to work but have not been successful
so far, what I'm trying to get done is;
open a word document which is already setup as a mailmerge document
merge the one record from the table to the document
save the fillin documment with a diff name
close the mailmerge document
close word
can someone fix my vba code
Dim strGetDoc As String, strOutNme As String
strGetDoc =
"\\Homa\CommonDbs\EventSpend\Documentation\Meeting Authorization.doc"
strOutNme =
"\\Homa\CommonDbs\EventSpend\Documentation\Authori ze.doc"
Dim objWord As Word.Document
Set objWord = GetObject(strGetDoc, "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:="\\Homa\CommonDbs\EventSpend\Apps\EventSpend XP.mdb", _
LinkToSource:=False, _
Connection:="Table tblAuthorizationData",
SQLStatement:="Select * from [tblAuthorizationData]"
'Execute the mail merge.
objWord.MailMerge.Destination = wdSendToNewDocument
objWord.SaveAs (strOutNme)
objWord.MailMerge.Execute
'close the Word application
objWord.Application.Quit
Set objWord = Nothing
thanks for any and all help
bobh.