Word Mail Merge Question - Access 97

F

fscs

I have a form that has two combo fields for filtering purposes. The first
combo has a list of queries and the second combo has a list of word
documents. I would like for my client to be able to select the query they
want to use and then select the letter that they want to merge the query
with and then have it merge in MS Word. I can get my merge code to use the
letter selected but I can't get it to use the query selected from the list.
Any help would be greatly appreciated.

Below is the code I am trying to use:

Dim objWord As Word.Document
Set objWord = GetObject(Me.Letter.Column(2), "Word.Document")
objWord.Application.Visible = True
objWord.MailMerge.OpenDataSource _
Name:="C:\Windows\Desktop\MailMergeTest.mdb", _
LinkToSource:=True, _
Connection:="Query QryLettersContributors", _
SQLStatement:="SELECT * FROM [QryLettersContributors]"
objWord.MailMerge.Execute
End Sub

Is it possible to use something like the example below?
Connection:= Me.QueryFilter
SQLStatement:= Me.QueryFilter
 
F

fscs

Will this code work with batch merging instead of one record at a time? The
way they want it to work is to be able to put in a date range, select the
query and then select the letter that they want to merge the group of names
with. Is this possible?

Thanks for all your help.
 

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