I'm programmatically writing text into Word using a word object "CreateObject("Word.Application")".
I then print this document using ".ActiveDocument.PrintOut".I want to be able to change the default printer before printing. I want to avoid using the printer common dialogue.
I want to display a simple list of installed printers to the user. How do I do this ?
On selecting one, that should be made the default so that the word document gets printed to the specified printer. How do I go about this ?
Also is there a way to list paper types / printer trays so that the printer uses specified paper type or the specified tray ?
Code samples would be great. I use VB6.0.
Currently I am listing printers using
Private Sub Form_Load()
text1 = Printer.DeviceName
text2 = Printer.Port
Dim X As Printer
For Each X In Printers
To change current printer can I use this ?
Private Sub Command1_Click()
Set Printer = Printers(List1.ListIndex)
But after this how do I ensure .ActiveDocument.PrintOut prints to the selected printer ?
I dont mind changing the default printer temporarily ...