MailMerge Function Issue

A

AccessARS

SCENARIO:
I have the following module in my database which merges data from a
temporary table (temp_PIC) in the same database into a COPY of a pre-designed
Word merge document template located on our server...

Function MergeIt()

Dim objWord As Word.Document
Set objWord =
GetObject("\\holnt01\public\Projects-Hollywood\CustomerCareAdministrative\Attendance\Write-ups\PIC Output\PicMerge1.doc", "Word.Document")
' Make Word visible.
objWord.Application.Visible = True
' Set the mail merge data source.
objWord.MailMerge.OpenDataSource _

Name:="\\holnt01\public\Projects-Hollywood\S3\Databases\Working\Attendance\Attendance.mdb", _
LinkToSource:=True, _
Connection:="TABLE temp_PIC", _
SQLStatement:="SELECT * FROM [temp_PIC]"
' Execute the mail merge.
objWord.MailMerge.Execute
objWord.Close

End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top