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
Peter Jamieson - 18 May 2006 23:18 GMT
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
> Hello, I'm using code to directly print a executed mailmerge document.
> It
[quoted text clipped - 20 lines]
> .Quit 0
> End With