Macro to send print job to FAX

T

Tareq

Hi there;
I made the following Macro to send a print to fax machine by pressing (ALT
3) and it works but the issue that after it send the fax job, it sent the fax
machine as the default printer. My question how can I continue using this
Macro without making the fax machine as the default printer. Help:)????

Sub Macro41()
'
' Macro41 Macro
' Macro recorded 1/30/2007 by tareq
'
ActivePrinter = "Network FAX for Windows"
Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wdPrintAllPages, _
ManualDuplexPrint:=False, Collate:=True, Background:=True, PrintToFile:= _
False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _
PrintZoomPaperHeight:=0
End Sub
 
P

Peter Jamieson

In theory you ought to be able to do something like...

Dim strActivePrinter As String
Dim strFaxPrinter As String
strFaxPrinter="Network FAX for Windows"

' save and set up the active printer
strActivePrinter = Application.ActivePrinter
' don't change the printer if it is already
' correctly set up
' (I had problems when I tried to switch
' to the fax printer in code)
' you may need to adjust this for your
' fax printer name
If Left(strActivePrinter, len(strFaxPrinter)) <> strFaxPrinter Then
Application.ActivePrinter = strFaxPrinter
Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wdPrintAllPages,
_
ManualDuplexPrint:=False, Collate:=True, Background:=True, PrintToFile:=
_
False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _
PrintZoomPaperHeight:=0
Application.ActivePrinter = strActivePrinter
End If

Peter Jamieson
 
T

Tareq

Hi there;

Thank you for reply .. but I am not that good with macros .. what do i
change in what you sent me . . . sorry to bother you with this
 
P

Peter Jamieson

OK, my suggestion is simply...

-----------------------
Sub Macro41x()
Dim strActivePrinter As String
Dim strFaxPrinter As String

strFaxPrinter="Network FAX for Windows"
If Left(strActivePrinter, len(strFaxPrinter)) <> strFaxPrinter Then
Application.ActivePrinter = strFaxPrinter
Application.PrintOut FileName:="", Range:=wdPrintAllDocument, _
Item:=wdPrintDocumentContent, Copies:=1, Pages:="", _
PageType:=wdPrintAllPages, ManualDuplexPrint:=False, Collate:=True, _
Background:=True, PrintToFile:=False, PrintZoomColumn:=0, _
PrintZoomRow:=0, PrintZoomPaperWidth:=0, PrintZoomPaperHeight:=0
Application.ActivePrinter = strActivePrinter
End If
End Sub
 

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