#96243 - 2002-11-29 05:25 AM
Re: RFC - Send a print job from KiX ?
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Would a COM Word.exe document work?
|
|
Top
|
|
|
|
#96246 - 2002-11-29 07:08 AM
Re: RFC - Send a print job from KiX ?
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
This maybe what you are looking for -
Win32_PrintJob.
HTH,
Kent
|
|
Top
|
|
|
|
#96249 - 2002-11-29 09:42 PM
Re: RFC - Send a print job from KiX ?
|
Waltz
Seasoned Scripter
Registered: 2002-08-01
Posts: 485
Loc: Waterloo, Ontario, Canada
|
Well, turns out to be much simpler than I expected it would be when I posed the challenge... Shawn's ole word code did the trick. For multiple printers, I'll just read an input file for share names and loop 'til done. Jooel's suggestion also works, for text files, in a shell/run context. Thanks once more to Shawn, Howard, Les, Kent, and Jooel for their brilliance and willingness to share it. FWIW, here's the basic test code... code:
;test.kix ;print a word document to the default printer ; $filename = "the_word.doc" ; $printer = "\\the_print_server\the_printer_share" ; If AddPrinterConnection ($printer) = 0 "Added printer connection "+$printer? If SetDefaultPrinter ($printer) = 0 "Set default printer to "+$printer? Else "Set default printer error "+@error+" "+@serror? Endif Else "Add printer error "+@error+" "+@serror? Endif ; $word = createobject("word.application") ; If @error = 0 $word.visible = 1 $nul = $word.documents.open("$filename") $nul = $word.activedocument.printout(0,0,0) $word.quit $word = 0 Else "Word launch error "+@error+" "+@serror? EndIf ; If DelPrinterConnection ($printer) = 0 "Deleted printer connection "+$printer? Else "Delete printer error "+@error+" "+@serror? Endif ;
Cheers...
_________________________
We all live in a Yellow Subroutine...
|
|
Top
|
|
|
|
#96256 - 2002-11-29 10:54 PM
Re: RFC - Send a print job from KiX ?
|
Waltz
Seasoned Scripter
Registered: 2002-08-01
Posts: 485
Loc: Waterloo, Ontario, Canada
|
|
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 293 anonymous users online.
|
|
|