Faxing From Access

  • Thread starter Thread starter DS
  • Start date Start date
D

DS

I'm trying to Fax directly from Access. I have a form that holds the
receivers name and fax number. I want to click on a send button and
have a document sent to that faxed number. I don't want the user to see
any fax application or anything come up...I've been looking around the
interent and this seems to be difficult. Any direction appreciated.
Thanks
DS
 
Its easy! I am using Access 2003 and this is my setup:

You need:
Access
Outlook (not sure if you can use Express)
Microsoft Fax installed (this can be a local fax or a shared fax with MS
Windows SBS Server 2003)

In Access create a Macro to export the report you want to fax, you will need
to export the report as an RTF file.

Setup the Outlook Reference (Click on Tools and click References and tick
'Microsoft Outlook <version no.> Object Library')

Now enter this code behind the button:

Dim MyOutlook As Outlook.Application
Dim MyMail As Outlook.MailItem

DoCmd.RunMacro "MACOutputReport"
Set MyOutlook = New Outlook.Application
Set MyMail = MyOutlook.CreateItem(olMailItem)
' do stuff with MyMail, e.g.
MyMail.To = "[Fax: " & Me!FaxNumberControl & "]"
MyMail.Subject = "Fax Report"
MyMail.Attachments.Add "C:\FaxReportAttch.rtf", olByValue, 1, "Fax Report"
MyMail.Body = "Hi, this is a fax" & vbNewLine

MyMail.Display

Set MyMail = Nothing
Set MyOutlook = Nothing


More details can be found here: http://www.jephens.com/howtoemail.asp

The code is normally used to send emails via Outlook but just changing the
'MyMail.To =' to a fax number or the fax number control on your form it will
open a new fax with the report as an attachment. The email is your cover page
and attachment is page 2. To make Outlook send it okay you must pass the fax
number in the form of [Fax: 01234 567890] otherwise you will be prompted to
select a contact from your address book! The code above will do this for you,
there are parts of the code you need to change (the fax number control, the
report location and file name and so on).

You can also have the fax or email sent without displaying on screen - just
change 'MyMail.Display' to 'MyMail.Send'

Hope it helps!
James
 
Hi James,

I tried it but I'm getting the error messager below. I don't have an
attachment. Can you tell what I'm doing wrong?

"The message could not be delivered because the recipient's destination
email system is unknown or invalid. Please check the address and try again,
or contact your system administrator to verify connectivity to the email
system of the recipient."


James said:
Its easy! I am using Access 2003 and this is my setup:

You need:
Access
Outlook (not sure if you can use Express)
Microsoft Fax installed (this can be a local fax or a shared fax with MS
Windows SBS Server 2003)

In Access create a Macro to export the report you want to fax, you will need
to export the report as an RTF file.

Setup the Outlook Reference (Click on Tools and click References and tick
'Microsoft Outlook <version no.> Object Library')

Now enter this code behind the button:

Dim MyOutlook As Outlook.Application
Dim MyMail As Outlook.MailItem

DoCmd.RunMacro "MACOutputReport"
Set MyOutlook = New Outlook.Application
Set MyMail = MyOutlook.CreateItem(olMailItem)
' do stuff with MyMail, e.g.
MyMail.To = "[Fax: " & Me!FaxNumberControl & "]"
MyMail.Subject = "Fax Report"
MyMail.Attachments.Add "C:\FaxReportAttch.rtf", olByValue, 1, "Fax Report"
MyMail.Body = "Hi, this is a fax" & vbNewLine

MyMail.Display

Set MyMail = Nothing
Set MyOutlook = Nothing


More details can be found here: http://www.jephens.com/howtoemail.asp

The code is normally used to send emails via Outlook but just changing the
'MyMail.To =' to a fax number or the fax number control on your form it will
open a new fax with the report as an attachment. The email is your cover page
and attachment is page 2. To make Outlook send it okay you must pass the fax
number in the form of [Fax: 01234 567890] otherwise you will be prompted to
select a contact from your address book! The code above will do this for you,
there are parts of the code you need to change (the fax number control, the
report location and file name and so on).

You can also have the fax or email sent without displaying on screen - just
change 'MyMail.Display' to 'MyMail.Send'

Hope it helps!
James

DS said:
I'm trying to Fax directly from Access. I have a form that holds the
receivers name and fax number. I want to click on a send button and
have a document sent to that faxed number. I don't want the user to see
any fax application or anything come up...I've been looking around the
interent and this seems to be difficult. Any direction appreciated.
Thanks
DS
 
Apologies for not getting back to your sooner!

From what I could understand Microsoft Fax can only send certain types of
documents and Access Snapshots is not one of them hence why I have to send
RTF documents.

This is how it works:
The report I want to fax (in my case a Sales Invoice) is exported to a
folder (in my case C:\Databases) by using a macro.

The email is created from the code and the exported file is attached to the
email/fax. The form requires a field which contain the fax number.


With connection to the error on sending the fax please could you make sure
that the fax number is being copied across in the format [Fax: 00000000]?
When the email/fax is display this is what you should have displayed in the
To: box. Secondly I have only been able to try this on a Small Business
Server network with the default Network Fax.

Hope it makes more sense!
James
 
I will see if I can also upload an example DB to my personal website in the
next couple of days. That way you can 'see' what I am trying to explain, I
always find it easier to see it in action!

James
 

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

Back
Top