Problem setting the active printer of Word 97 without changing the Windows default printer 
Author Message
 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



Thu, 21 Nov 2002 03:00:00 GMT  
 Problem setting the active printer of Word 97 without changing the Windows default printer
Hi Tommy,

Check out your post in the Word97VBA newsgroup.  There are a couple of
solutions to your problem there.

Please do not post the same question separately to multiple newsgroups.
Rather, put the newsgroups which you think might be applicable into the
header of a single message.  When you do this, a response in one ng will
automatically appear in all of the ng's which not only makes it easier to
find responses to your post but can prevent someone from developing and
answer to a question that has already been answered elsewhere.

Hope this helps,
Doug Robbins - Word MVP
Please post any follow-up to the Newsgroups so that others may benefit
therefrom or contribute thereto.

Quote:
> Hi there,

> I'm writing a little VBA program in Word 97 (SR-2) in which I need to
change
> the active printer of Word. Let's 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 don't 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 Word's 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



Fri, 22 Nov 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. code to set active printer in access 95 without using Win.ini (Windows NT)

2. Problem setting the active printer in WordAppObject

3. Changing Printers property reset printer to Windows default printer

4. http://www.mvps.org/word/Default.htm

5. Two problems with mailmerge from Access 97 to Word 97

6. Getting the printer settings without initialising the printer?

7. vba problem word 97 and not word 2000

8. Word 97 --> Word 2000 problem

9. Create Form Letter in Word 97 without using Mail Merge

10. Changing printer without changing default

11. Change printer in Outlook 97

12. Selecting a Printer Tray in Word 97 VBA

 

 
Powered by phpBB® Forum Software