Error when directly printing mailmerge document

D

Don

Hello, I'm using code to directly print a executed mailmerge document. It
works fine on my machine but one user receives the following error "You
cannot send a catalog created by merging documents directly to mail, fax, or
a printer". Also, when I use code to preview the merge document it's called
FormLetter on my machine, but on the other user's machine it's called
Catolog1. Anyone know why this happens? I've included by code below.

Thanks

Set objApp = CreateObject("Word.application")
strTextFile = sSalesDirectory & "\tmpContract.txt"
With objApp
.Visible = True
.Documents.Open strDocName
strDocNameB = objApp.ActiveDocument.Name
.ActiveDocument.MailMerge.OpenDataSource strTextFile
.ActiveDocument.MailMerge.Destination = 1 'wdSendtoprinter
.ActiveDocument.MailMerge.Execute
.Documents(strDocNameB).Close 0
.Quit 0
End With
 
P

Peter Jamieson

best guess:
- you are opening a document whose name is stored in strDocName
- on one machine, this document is already set up as a mailmerge
catalog/directory type document; on the other machine, it's set up as a Fomr
Letters type merge document (the default merge type document) or a "Normal
Word Document".
- Using OpenDataSource wil not change an existing merge document type
unless it's "Normal Word Document", in which case the type will become, by
defualt, "Form Letters"
- when you merge to a new document, the name of the output document depends
on the merge type.

Peetr Jamieson
 

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