Fax Report

  • Thread starter Thread starter Darb
  • Start date Start date
D

Darb

Thanks for taking the time to read my question.

Has anyone tried sending a report to XP's faxing
function? XP's faxing function is set up like a
printer. So I can send my report as a fax, but I have to
use the wizzard to complete the process. I would like
this process to be automated (not have to use the
wizzard).
Is anyone aware of some commands, or command line info I
can use to achieve my goal?

Thanks again,

Darb
 
Darb:

There's really no convient way to directly automate the Windows 2000 / Xp
fax service. There is an Active X object called the "Microsoft Fax Service
Extended Com Tools" which allows you to automate the fax service itself.
However, you need to be able to supply that object with a faxable file
(normally a tiff object). You'd need a Tiff printer driver to support using
the Active X method in its best form.

On the other hand, there is also a method to automate the output via
Outlook. To do this, you first need to add the fax service to your Outlook
profile.

If you are using Outlook Xp or 2003, then go to Tools - > Email Accounts and
choose to add a new account. When the account type dialog pops up, choose
Additional Servers. In the next dialog you should see the "Fax Mail
Transport". Choose that and then click next.

Then once the fax transport is added, you can use the SendObject method to
send the fax via Outlook. To do that you specify the recipient's fax
number in the To: address property of SendObject in the following format:
[Fax: 800-555-1212] with the brackets.

However there are many challenges with the send object method:

1.) You have to manually go in to the Outlook mail item and set its sending
account to be the Fax Mail Transport rather than your default mail account.
2.) As with any other use of Send Object, you are limited to using RTF, text
or HTML format for the output, which can cause problems.
3.) Outlook's security issues will require you to approve every outgoing
fax.
4.) You can't filter a report for a specific recipient when using
SendObject.

End result is that automating use of the built in Xp fax system is not a
very good route to try and go. If you want to send lots of faxes, then you
might look at using Symantec's WinFax (version 10.03 is the latest, don't
use version 10.02 it doesn't support automation). That can be automated
fairly directly. If you have a copy of that, then you could use something
like our WinFax library to easily send faxes (including filtering your
report) with about 6-8 lines of code; you'd find that on our web.

HTH
 
Darb:

If you wanted to play with the Fax Active X object, I've shown some code
below to do that. There are a few things to note.

1.) The Active X fax service can output other types of files other than Tiff
objects, its just that it will convert those files to a Tiff image and leave
the server that prints the object running on your machine and will also not
clean up after itself by deleting temporary tiff object. If you supply the
service with a TIFF file using a Tiff printer driver (as recommended in our
first post,) then it cleans up after itself.

2.) So you could output an RTF file of your report from Access using
OutputTo (With RTF, you'll loose most of your formatting, so the code below
shows doing this with a PDF file that was created from an Access report
using our PDF and Mail Library.) If you choose an RTF output you'll have
to use a filter by form method for your fax report to filter it for specific
recipients.

HTH
--
Steve Arbaugh
ACG Soft
http://ourworld.compuserve.com/homepages/attac-cg

Here's sample code:

Private Declare Function GetTempPath Lib "kernel32" Alias _
"GetTempPathA" (ByVal dwChrBuff&, ByVal strBuff$) As Long

Public Function FaxXpTest(Optional StartFax As Boolean = 0)
'StartFax, is used to pause the fax service when sending and after
'all faxes are queued, then to resume send capabilities. Requires
'administrator privileges.
On Error Resume Next
Dim objFax As Object
Dim objFaxDoc As Object
Dim objAcro As Object
Dim objAvDoc As Object
Dim strDocFile As String
Dim strFileName As String, strTempPath$
Dim lngJobID As Long
Dim strBuffer$
Dim lngBuffer&, dwReturn&

lngBuffer = 256
strBuffer = Space(lngBuffer)
dwReturn = GetTempPath(lngBuffer, strBuffer) 'An api call
strTempPath = left(strBuffer, InStr(strBuffer, Chr(0)) - 1)
Set objFax = CreateObject("FaxServer.FaxServer")
objFax.Connect (vbNullString)

If StartFax = False Then
'Solely because we're using Acrobat files to fax _
not necessary otherwise. This works with Reader as well.
Set objAcro = CreateObject("AcroExch.App")

strFileName = "c:\documents\test file.pdf"
'this next command is only available if _
running as an administrator
objFax.PauseServerQueue = True

Set objFaxDoc = objFax.CreateDocument(strFileName)
With objFaxDoc
.FaxNumber = "18005551212"
lngJobID = .Send()
Debug.Print lngJobID
End With
Set objFaxDoc = Nothing
'Used only with PDF file faxes
objAcro.CloseAllDocs
Set objAcro = Nothing
'Clean up after the fax service
Kill strTempPath & "\*.pdf"
Kill strTempPath & "\*.tif"
Else
objFax.PauseServerQueue = False
End If
objFax.Disconnect
Set objFax = Nothing
End Function



SA said:
Darb:

There's really no convient way to directly automate the Windows 2000 / Xp
fax service. There is an Active X object called the "Microsoft Fax Service
Extended Com Tools" which allows you to automate the fax service itself.
However, you need to be able to supply that object with a faxable file
(normally a tiff object). You'd need a Tiff printer driver to support using
the Active X method in its best form.

On the other hand, there is also a method to automate the output via
Outlook. To do this, you first need to add the fax service to your Outlook
profile.

If you are using Outlook Xp or 2003, then go to Tools - > Email Accounts and
choose to add a new account. When the account type dialog pops up, choose
Additional Servers. In the next dialog you should see the "Fax Mail
Transport". Choose that and then click next.

Then once the fax transport is added, you can use the SendObject method to
send the fax via Outlook. To do that you specify the recipient's fax
number in the To: address property of SendObject in the following format:
[Fax: 800-555-1212] with the brackets.

However there are many challenges with the send object method:

1.) You have to manually go in to the Outlook mail item and set its sending
account to be the Fax Mail Transport rather than your default mail account.
2.) As with any other use of Send Object, you are limited to using RTF, text
or HTML format for the output, which can cause problems.
3.) Outlook's security issues will require you to approve every outgoing
fax.
4.) You can't filter a report for a specific recipient when using
SendObject.

End result is that automating use of the built in Xp fax system is not a
very good route to try and go. If you want to send lots of faxes, then you
might look at using Symantec's WinFax (version 10.03 is the latest, don't
use version 10.02 it doesn't support automation). That can be automated
fairly directly. If you have a copy of that, then you could use something
like our WinFax library to easily send faxes (including filtering your
report) with about 6-8 lines of code; you'd find that on our web.

HTH
--
Steve Arbaugh
ACG Soft
http://ourworld.compuserve.com/homepages/attac-cg

Darb said:
Thanks for taking the time to read my question.

Has anyone tried sending a report to XP's faxing
function? XP's faxing function is set up like a
printer. So I can send my report as a fax, but I have to
use the wizzard to complete the process. I would like
this process to be automated (not have to use the
wizzard).
Is anyone aware of some commands, or command line info I
can use to achieve my goal?

Thanks again,

Darb
 
Back
Top