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