Printer Problems

J

Jan Hyde

(This code is actually VB code)

Dim strOldPrinter As String
Dim strPrinterName As String

strOldPrinter = wdDoc.Application.ActivePrinter
strPrinterName = Printer.DeviceName
wdDoc.Application.ActivePrinter = strPrinterName [1]
wdDoc.PrintOut
wdDoc.Application.ActivePrinter = strOldPrinter [2]

As soon a line [1] has been issued the printer object can no
longer be used

'484 Problem getting printer information from the system'

As soon as line [2] has been issued the printer object works
as normal.

I'm using word 2000.

This problem only occurs with certain printer drivers.

Is this a known issue? Is there a way around the problem?


Line [1] also causes the default printer on the Pc to be
changed. This is highly undesirable since it can cause other
programs to print to the wrong printer. Is there a way I can
tell word 2000 to leave the default printer alone?

J
 
D

Doug Robbins - Word MVP

Hi Jan,

See the article "Changing the selected (current) printer in Word without
changing the system default printer" at:

http://www.mvps.org/word/FAQs/MacrosVBA/ChangeCurPrinter.htm

and "How can I get a list of the available printer names?" at:

http://www.mvps.org/word/FAQs/MacrosVBA/AvailablePrinters.htm

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
J

Jan Hyde

"Doug Robbins - Word MVP" <[email protected]>'s wild thoughts
were released on Tue, 18 Nov 2003 18:03:55 +1000 bearing the
following fruit:
Hi Jan,

See the article "Changing the selected (current) printer in Word without
changing the system default printer" at:

http://www.mvps.org/word/FAQs/MacrosVBA/ChangeCurPrinter.htm

The other solution I found was to use

WordBasic.FilePrintSetup Printer:=Printer.DeviceName,
DoNotSetAsSysDefault:=1

However, I think I'll go with the solution you suggested.

J
and "How can I get a list of the available printer names?" at:

http://www.mvps.org/word/FAQs/MacrosVBA/AvailablePrinters.htm

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
Jan Hyde said:
(This code is actually VB code)

Dim strOldPrinter As String
Dim strPrinterName As String

strOldPrinter = wdDoc.Application.ActivePrinter
strPrinterName = Printer.DeviceName
wdDoc.Application.ActivePrinter = strPrinterName [1]
wdDoc.PrintOut
wdDoc.Application.ActivePrinter = strOldPrinter [2]

As soon a line [1] has been issued the printer object can no
longer be used

'484 Problem getting printer information from the system'

As soon as line [2] has been issued the printer object works
as normal.

I'm using word 2000.

This problem only occurs with certain printer drivers.

Is this a known issue? Is there a way around the problem?


Line [1] also causes the default printer on the Pc to be
changed. This is highly undesirable since it can cause other
programs to print to the wrong printer. Is there a way I can
tell word 2000 to leave the default printer alone?

J
 
J

Jan Hyde

Jan Hyde <[email protected]>'s wild thoughts
were released on Tue, 18 Nov 2003 09:20:17 +0000 bearing the
following fruit:
"Doug Robbins - Word MVP" <[email protected]>'s wild thoughts
were released on Tue, 18 Nov 2003 18:03:55 +1000 bearing the
following fruit:


The other solution I found was to use

WordBasic.FilePrintSetup Printer:=Printer.DeviceName,
DoNotSetAsSysDefault:=1

However, I think I'll go with the solution you suggested.

Scrap that. It needs to work on Word97 so I'll have to go
with the wordbasic solution.

J
and "How can I get a list of the available printer names?" at:

http://www.mvps.org/word/FAQs/MacrosVBA/AvailablePrinters.htm

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
Jan Hyde said:
(This code is actually VB code)

Dim strOldPrinter As String
Dim strPrinterName As String

strOldPrinter = wdDoc.Application.ActivePrinter
strPrinterName = Printer.DeviceName
wdDoc.Application.ActivePrinter = strPrinterName [1]
wdDoc.PrintOut
wdDoc.Application.ActivePrinter = strOldPrinter [2]

As soon a line [1] has been issued the printer object can no
longer be used

'484 Problem getting printer information from the system'

As soon as line [2] has been issued the printer object works
as normal.

I'm using word 2000.

This problem only occurs with certain printer drivers.

Is this a known issue? Is there a way around the problem?


Line [1] also causes the default printer on the Pc to be
changed. This is highly undesirable since it can cause other
programs to print to the wrong printer. Is there a way I can
tell word 2000 to leave the default printer alone?

J
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top