Download Print.Test.Page.OK 3.011/8/2024 HelpContext Local $ErrorLastDllError = $oWordErrorHandler. HelpFile Local $ErrorHelpContext = $oWordErrorHandler. Source Local $ErrorHelpFile = $oWordErrorHandler. WinDescription, 2 ) Local $ErrorSource = $oWordErrorHandler. description, 2 ) Local $ErrorWinDescription = StringStripWS ( $oWordErrorHandler. number, 8 ) Local $ErrorDescription = StringStripWS ( $oWordErrorHandler. number Local $ErrorNumberHex = Hex ( $oWordErrorHandler. scriptline Local $ErrorNumber = $oWordErrorHandler. I thought I solved it but the default printer was just tricking me.Įxpand collapse popup #include Global $oWordApp = _WordCreate ( "" ) Global $oDoc = _WordDocOpen ( $oWordApp, & "Test.doc" ) $oWordErrorHandler = ObjEvent ( "AutoIt.Error", "MyErrFunc" ) _WordDocPrint ( $oDoc, 0, 1, - 1, 1, "spool3xyz" ) ConsoleWrite ( & "-" & & ) _WordQuit ( $oWordApp ) Exit Func MyErrFunc ( ) Important: the error object variable MUST be named $oWordErrorHandler Local $ErrorScriptline = $oWordErrorHandler. PS I did post this question a month or two ago. My Message box after the _WordDocPrint() command returns 00. _WordDocPrint($hWordDocument, $BackgroundPrint, $Copies, $Orientation, $Collate, $PrinterName, $Range, $PageFrom, $PageTo, $Pages, $PageType, $Item) _WordDocPrint($hwordDocument) <- This prints to the default printer $hWordDocument = _WordDocGetCollection($hWordApplication, 0) Local $printerName="\\vjraywks05\HPOfficejet6500" Local $PageType=0 0=All, 1=Odd and 2=Even Local $Pages=0 The page numbers to be printed seperated by commas when Range=4 Local $PageFrom=0 Starting page when Range=3 I started with the example script so I should be very close. I have made a cut down example to demonstraight the problem. I have compiled both 32 and 64bit exe's and they both do the same thing. If I don't specify a printer and send it to the default printer it prints OK. I have tried a shared network name and a local printer name and niether work. I am trying to print a word document and nothing comes out when I try to specify the printer by name. I'm running Windows 7 64 bit and Office 2010 64bit.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |