Hello,
I am trying to find a way to select another printer using a macro. For example, in Excel you can do that by using:
Application.ActivePrinter = "[PrinterName]"
...but of course that doesn't work in Coreldraw. I searched in the OLH to find the right code but I can't find it. Can smeone please help me out? So I first need to select another printer and then send the document to it using FilePrint. Thanks i.a. for your help.
Kind regards,
Tim.
Hi again,
I saw that I asked the same question in 2010 and someone replied:
Try this:
Sub printIt() With ActiveDocument.PrintSettings .SelectPrinter "myprinter" End WithEnd Sub
...but that doesn't work. Using that code, it generates an errormessage that "the property or method is not supported by this object" (Error 438). Hope I translated it right. Back then, in 2010 I also couldn't find a solution. Does anyone have other ideas? Thanks again,
Kind regards.
Just a guess, but the printer name is not exactly correct ?
To find out, you could temporarily make that printer the default printer and then browse the properties in the VBA debugger.
I don't have version 9 to test, but X7 help file suggests ActiveDocument.PrintSettings.Printer.Name should display it.
Or you could try this (tested in X7, so not necessarily applicable to v9) to show all the available printer names:
txt = "" For i = 1 To Printers.Count txt = txt + Printers(i).Name + vbLf Next i MsgBox (txt)