Hello
We have different HP printers throughout the firm and I need to write a
macro that will print a 5 page letter. First page to go from tray 3 and
subsequent pages from tray 2. Unfortunately, not all tray numbers are they
same, they range from 257 through to 260. Can I use an IF statement, to say:

If Active Printer = HP4350 Then
blah blah,
Else If ActivePrinter = HP4300 Then
blah blah
End If

Or does Word not recognize the printers?

Any help with this would be greatly appreciated.

Many thanks.

Re: Recognizing Printer by Steve

Steve
Thu Dec 06 14:35:03 PST 2007

Word recognizes the printers.

Sub TestPrinterActive()
If InStr(Application.ActivePrinter, "HP4350") > 0 Then
MsgBox "Bingo"
Else
MsgBox "Oops"
End If
End Sub

You can use a bunch of ElseIf lines as you suggest or a Select Case. I'd
use InStr like I did in the example rather than insist on a complete match
as the printer name is often appended with network descriptions when you use
Application.ActivePrinter.


Steve



"Noella" <Noella@discussions.microsoft.com> wrote in message
news:B17C9406-3A05-4987-8CDD-0B40E990C72F@microsoft.com...
> Hello
> We have different HP printers throughout the firm and I need to write a
> macro that will print a 5 page letter. First page to go from tray 3 and
> subsequent pages from tray 2. Unfortunately, not all tray numbers are
> they
> same, they range from 257 through to 260. Can I use an IF statement, to
> say:
>
> If Active Printer = HP4350 Then
> blah blah,
> Else If ActivePrinter = HP4300 Then
> blah blah
> End If
>
> Or does Word not recognize the printers?
>
> Any help with this would be greatly appreciated.
>
> Many thanks.
>
>