Word Mail Merge Question - Access 97

  • Thread starter Thread starter fscs
  • Start date Start date
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
 
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.
 
Back
Top