From: hannu on 18 Aug 2010 07:31 Hi. I have a vbs-file, which prints me word-document. I would like to print it to different printers some times and I would like to have a possibility to select printer during the code. What is the code for that? Thanks!
From: Tom Lavedas on 18 Aug 2010 09:47 On Aug 18, 7:31 am, hannu <hannutlappalai...(a)gmail.com> wrote: > Hi. > > I have a vbs-file, which prints me word-document. > > I would like to print it to different printers some times and I would > like to have a possibility to select printer during the code. > > What is the code for that? > > Thanks! WSH has the SetDefaultPrinter method. From the down loadable documentation ... Assigns a remote printer the role Default Printer. object.SetDefaultPrinter(strPrinterName) where object is the WshNetwork object. If you do this before opening the Word object, it will send all print jobs to that printer. Then reset it to back the original default after. There may also be a printer control in the Word VBA object model, but I don't have the time to search that out. _____________________ Tom Lavedas
|
Pages: 1 Prev: smtpreg error Next: CDO message with attachment problems |