Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Don
 
Posts: n/a
Default Error when directly printing mailmerge document

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
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson
 
Posts: n/a
Default Error when directly printing mailmerge document

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

"Don" wrote in message
...
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



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Printing objects in a Word document DLS Microsoft Word Help 0 May 9th 06 02:33 PM
Printing a master document Writers-ink Formatting Long Documents 1 June 10th 05 06:13 PM
Protect mailmerge document BillM Mailmerge 1 June 9th 05 12:58 PM
How to mailmerge formatted text from a Exel to Word document? islander Mailmerge 2 May 24th 05 03:57 PM
Word 2000 printing landscape pages - orientation in final document KLK Microsoft Word Help 1 May 16th 05 03:11 PM


All times are GMT +1. The time now is 08:52 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"