M
MorningStarFan
Hi All,
We have used automation to create documents via word mailmerge from our
access db. We can just press a button and as long as all our dbs and files
are in place, it works great! Except for our records that need to have
multiple recipients for one letter, multiple student awards for one recipient
award report, etc. Does anyone know how we could modify the code and the
documents or the data or a combination of some or all so that when multiple
students have been recipients for a single scholarship fund one award report
is produced? See our code that we are currently using to create the documents
below...We could have three donors to thank in a letter or one or two. We
could also have one, two, three or more students data to print on an award
report.
Function MergeIt_Awards()
Dim objWord As Word.Document
Set objWord =
GetObject("C:\Stewardship_automation\STUDENT_AWARDS_REPORT_3.doc",
"Word.Document")
' Make Word visible.
objWord.Application.Visible = True
' Set the mail merge data source as db2.
objWord.MailMerge.OpenDataSource _
Name:="C:\Stewardship_automation\" & _
"db2.mdb", _
LinkToSource:=True, _
Connection:="TABLE QRY_FORMAL_FUNDNAME", _
SQLStatement:="SELECT * FROM [QRY_FORMAL_FUNDNAME]"
' Execute the mail merge.
objWord.MailMerge.Execute
End Function
Thanks in advance!
We have used automation to create documents via word mailmerge from our
access db. We can just press a button and as long as all our dbs and files
are in place, it works great! Except for our records that need to have
multiple recipients for one letter, multiple student awards for one recipient
award report, etc. Does anyone know how we could modify the code and the
documents or the data or a combination of some or all so that when multiple
students have been recipients for a single scholarship fund one award report
is produced? See our code that we are currently using to create the documents
below...We could have three donors to thank in a letter or one or two. We
could also have one, two, three or more students data to print on an award
report.
Function MergeIt_Awards()
Dim objWord As Word.Document
Set objWord =
GetObject("C:\Stewardship_automation\STUDENT_AWARDS_REPORT_3.doc",
"Word.Document")
' Make Word visible.
objWord.Application.Visible = True
' Set the mail merge data source as db2.
objWord.MailMerge.OpenDataSource _
Name:="C:\Stewardship_automation\" & _
"db2.mdb", _
LinkToSource:=True, _
Connection:="TABLE QRY_FORMAL_FUNDNAME", _
SQLStatement:="SELECT * FROM [QRY_FORMAL_FUNDNAME]"
' Execute the mail merge.
objWord.MailMerge.Execute
End Function
Thanks in advance!