Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have an Excel spreadsheet that prints an MS Word
document with field code links back to values in the Excel Spreadsheet. Basically I cycle through all the rows in the Excel spreadsheet and print the Word Document for each line in the Excel file. I built the application using Windows XP, and Office XP 2002--works fine. I have tried running it on a PC running Windows XP, and Office 2000. The Word document printing hangs without a 3-second wait. At the end it will not end properly, and prompts the user that "Ending Word will stop the print jobs (2 print jobs left are left)". Any idea how to overcome this? Below is the basic code I am using: Dim wdApp As Object Set wdApp = CreateObject("Word.Application") Set wdDoc = wdApp.documents.Open ("C:\fldr\Templates\FormR1.dot") Do until eof wdApp.activedocument.PrintOut Background:=True, Copies:=1, Collate:=True *** This section of code will not work in Word 2000 *** ' lngstatus = 1 'wdApp.BackgroundPrintingStatus ' Do Until lngstatus = 0 ' lngstatus = wdApp.BackgroundPrintingStatus ' Loop *** This is the workaround with a wait included *** newhour = Hour(Now()) newMinute = Minute(Now()) newSecond = Second(Now()) waitTime = TimeSerial(newhour,newMinute,newSecond) Application.Wait waitTime Loop *** Hangs on the following line, even with a wait added *** wdApp.activedocument.Close wordfile = wdApp.Quit Thanks for your help!! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel VBA Programming: Word Document Compare? | Excel Discussion (Misc queries) | |||
Excel - Printing a page that contains an Embedded Word Document | Excel Discussion (Misc queries) | |||
Problems printing a word document with linked excel tables. | Excel Discussion (Misc queries) | |||
Printing a Word document from an excel macro | Excel Programming | |||
Printing a Word document from an excel macro | Excel Programming |