Mail Merge Again

expublish

Registered User.
Local time
Today, 16:35
Joined
Feb 22, 2002
Messages
121
I am setting up a mail merge based on a query that filters data from a table. I have it setup mostly correct apart from one bit. I think it is this bit thats wrong:

objWord.MailMerge.OpenDataSource _
Name:=CurrentDb.Name, _
linktosource:=True, _
Connection:="QUERY empunit-mm-head", _
SQLStatement:="Select * FROM [empunit-mm-head]"
objWord.MailMerge.Execute

This is pulled out of the whole lot of code. If you need the whole lot let me know. The query that holds the data that is being merged is called empunit-mm-head.

I am getting the message 'File name or class name not found during the automation process'.

Can anyone help?

Scott.
 
Here is the code that I used to use a query as the datasource for a mail merge document.

DoCmd.OpenQuery "qryProspectMerge", acViewNormal

intAnswer = MsgBox("Is this the correct information?", vbYesNo, "Confirm Results of Query")

If intAnswer = vbYes Then
DoCmd.Close acQuery, "qryprospectmerge", acSaveNo

pm_entry ("qryProspectMerge")
ElseIf intAnswer = vbNo Then
DoCmd.Close acQuery, "qryprospectmerge", acSaveNo
Exit Sub
End If

[This message has been edited by Elana (edited 03-08-2002).]
 

Users who are viewing this thread

Back
Top Bottom