G
Guest
Hi. I am trying to automate Mail Merge. I understand it can be done using
vba (what can't if you only know the code!). I want to kick of mail merge
using an query (qrySol) and using an existing word document (SolLetter).
Seaching Microsoft.com, I found a snippet:
<MailMergeObject>.OpenDataSource Name:="C:\MyDataSource.odc",
SQLStatement:="SELECT * FROM [MyTable]"
How can I put my query and word names into the statement (meaning, what is
my MailMergeObject name, what does Name:="C:\MyDataSource.odc" refer to?
I don't want to state a SQLStatement since my query is a SQL statement.
And once the code statement is correct, how do I kick it off within my code?
I appreciate any suggestions (details being very nice!). Thanks for your
time!
vba (what can't if you only know the code!). I want to kick of mail merge
using an query (qrySol) and using an existing word document (SolLetter).
Seaching Microsoft.com, I found a snippet:
<MailMergeObject>.OpenDataSource Name:="C:\MyDataSource.odc",
SQLStatement:="SELECT * FROM [MyTable]"
How can I put my query and word names into the statement (meaning, what is
my MailMergeObject name, what does Name:="C:\MyDataSource.odc" refer to?
I don't want to state a SQLStatement since my query is a SQL statement.
And once the code statement is correct, how do I kick it off within my code?
I appreciate any suggestions (details being very nice!). Thanks for your
time!