Problem setting the active printer of Word 97 without changing the Windows default printer
Hi there,
Im writing a little VBA program in Word 97 (SR-2) in which I need to change
the active printer of Word. Lets say: from PRINTER 1 to PRINTER 2 (e.g.
PRINTER 1 = HP DeskJet 690C and PRINTER 2 = HP LaserJet 6L PCL).
In the Word VBA help file, I found the following property (of Application
object): ActivePrinter
So I used the following line of code to change the active printer in Word
from PRINTER 1 to PRINTER 2:
ActivePrinter = PRINTER 2
This code seemed to work fine, as it changed my active printer in Word (see
menu command File/Print... in Word) to PRINTER 2.
Unfortunately, this line of code also changed the Windows default printer
(see Start/Settings/Printers in Windows) to PRINTER 2. And this is
something I dont want! (because then all the other Windows applications
will use PRINTER 2 instead of PRINTER 1).
Can anybody help me here? Did I forget something in my code? (or is it a bug
in Word 97?)
Can anybody tell me how to change Words active printer without changing the
Window default printer? If need be, by using a (simple) Windows API call.
Any help will be very much appreciated.
Thanks.
Regards,
Tommy