Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / February 2006

Tip: Looking for answers? Try searching our database.

Error to Automation mailmerge to printer in word 2003

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
alamas - 31 Jan 2006 13:07 GMT
hi!
Automation mailmerge with next vb code:

g_objWord.Documents.Ope
FileName:=GetTitleFromFilename(g_strFileTemplate)
g_objWord.ActiveDocument.MailMerge.MainDocumentType = wdFormLetters
g_objWord.ActiveDocument.MailMerge..OpenDataSource Name:=sDataFile
g_objWord.Options.UpdateLinksAtPrint = True
g_objWord.Options.UpdateFieldsAtPrint = True

With g_objWord.ActiveDocument
.MailMerge.SuppressBlankLines = False
.MailMerge.Destination = 1    '= wdSendToPrinter
.MailMerge.DataSource.FirstRecord = 1  
.MailMerge.DataSource.LastRecord = -16
.MailMerge.Execute
.Close 0
End With

'*************************************************
the template has a table. I need adjust the dimensions of cells in m
table to reflect the data that is in them.

It works correctly when:
- mailmerge to a new document.(Manually or with this code)
- mailmerge to printer.(Manually)

I want to send the document to a printer.

Thanks

--
alamas
Doug Robbins - Word MVP - 31 Jan 2006 18:45 GMT
And what happens when you use the code to merge it to the printer?

How to you expect to be able to adjust the dimensions of the cells of the
table if you are going to use automation to merge the document directly to
the printer?

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> hi!
> Automation mailmerge with next vb code:
[quoted text clipped - 26 lines]
>
> Thanks.
alamas - 01 Feb 2006 07:39 GMT
My printer is Acrobat distiller 5
when i use the code to merge it to the printer i obtain the pdf
document without to adjust the dimensions of the cells.
with word 2000 works correctly although it shows the print dialog box.

Signature

alamas

Doug Robbins - Word MVP - 02 Feb 2006 18:53 GMT
See the article "How to do a mail merge to the printer using VBA, without
displaying the Print dialog" at:

http://www.word.mvps.org/FAQs/MailMerge/MergeStraightToPrintrWVBA.htm

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> My printer is Acrobat distiller 5
> when i use the code to merge it to the printer i obtain the pdf
> document without to adjust the dimensions of the cells.
> with word 2000 works correctly although it shows the print dialog box.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.