Active printer

M

Marijan Glavac

Hi,

I have trouble with deteremine fax printer on network.
My code is :
Application.ActivePrinter ="\\server\Fax on Ne03"
Problem is that from time to time my fax printer chnage in to ="\\server\Fax
on Ne06" or ="\\server\Fax on Nexx"
Printer has been shared and the share name is "FAX"
But when I wrote :
Application.ActivePrinter ="FAX"
I got error :
Run-tem error '1004'
Method ' ActivePrinter' of object '_Appliction' failed.

Please help.

Marijan Glavaè
 
J

Jim Rech

You have to trap the error and try again. an example:

Sub SetFax()
On Error Resume Next
Err.Clear
Application.ActivePrinter = "\\server\Fax on Ne03"
If Err.Number <> 0 Then
Err.Clear
Application.ActivePrinter = "\\server\Fax on Ne06"
If Err.Number <> 0 Then
Err.Clear
Application.ActivePrinter = "\\server\Fax on NeXX"
If Err.Number <> 0 Then MsgBox "Cannot set FAX"
End If
End If
End Sub

--
Jim Rech
Excel MVP
| Hi,
|
| I have trouble with deteremine fax printer on network.
| My code is :
| Application.ActivePrinter ="\\server\Fax on Ne03"
| Problem is that from time to time my fax printer chnage in to
="\\server\Fax
| on Ne06" or ="\\server\Fax on Nexx"
| Printer has been shared and the share name is "FAX"
| But when I wrote :
| Application.ActivePrinter ="FAX"
| I got error :
| Run-tem error '1004'
| Method ' ActivePrinter' of object '_Appliction' failed.
|
| Please help.
|
| Marijan Glavaè
|
|
|
 

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