LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default excel vba word merge printer error

I have an Excel vba macro that does a Word mail merge. If the
resulting document gets over a few pages in size, the printer prints
some of the pages, then throws out an error page that is pretty
meaningless dump of junk and stops printing. (I am guess it is from
some sort of over run of data in the buffer ?). If I modify the vba
code to send the resulting document to a new Word document, then print
that document from Word, it prints just fine.

Any idea why this happens? Does this method of printing do something
different than printing right from Word ?

Here is the code:
Dim oWord As Word.Application
Dim oMainDoc As Word.Document
Dim oOutputDoc As Word.Document
Dim omm As Word.MailMerge

Set oWord = CreateObject("Word.Application")
Set oDoc = oWord.Documents.Open("p:\carbboom online
system\onlineorders.doc")
Set omm = oDoc.MailMerge
With omm
.DataSource.FirstRecord = wddefaultfirstrecord
.DataSource.LastRecord = wdDefaultLastRecord

.Destination = wdSendToPrinter

.Execute Pause:=False
End With

Set oOutputDoc = Nothing
Set omm = Nothing
oDoc.Close
Set oDoc = Nothing
oWord.Quit
Set oWord = Nothing

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
merge two excel files like in word mail merge azmerritt Excel Discussion (Misc queries) 1 December 11th 16 09:23 PM
Word, Excel and PowerPoint look for my printer before they open, w Poobabe Excel Discussion (Misc queries) 2 September 7th 07 05:18 PM
Trying to merge from excel to word. New names won't merge ruth tozer Excel Worksheet Functions 0 June 27th 07 05:58 AM
Cell 255 Character - Error Mail merge to MS word. Randoo Excel Discussion (Misc queries) 3 January 8th 07 06:09 PM
Excel PageSetup Error even when a printer Exists jo Excel Programming 1 January 11th 06 02:21 AM


All times are GMT +1. The time now is 07:27 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"