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 ...
Here are a few simple, working, games that you can use as-is or as the basis for your own games.
This is one of the simplest of all games.
The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…