Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Faxing a JPG Attachment Causes Error When Using Outlook

Status
Not open for further replies.

LincolnMarkV

Programmer
Dec 22, 2003
72
0
0
US
Hello all,

I am trying to setup a fax function that is run from a command button on a form. The reports gather info from the form and the report is saved to the C drive. This works fine for Snapshot (.snp) files, but is giving me problems when trying to attach a (.jpg) or a (.txt) file. Below is the code used in my command button.

------------------------------------------------------------

Private Sub cmdFax_Click()

DoCmd.OutputTo acOutputReport, "rptStaffInformation", "Snapshot Format", "C:\StaffInformation.snp", False

Dim MyOutlook As Outlook.application
Dim MyMail As Outlook.MailItem
Dim FaxNumber As String

FaxNumber = Me.txtPhoneNumber

Set MyOutlook = New Outlook.application
Set MyMail = MyOutlook.CreateItem(olMailItem)

MyMail.To = "[Fax: " & FaxNumber & "]"
MyMail.Attachments.Add "C:\StaffInformation.snp", olByValue, 1, "Cover Page"
MyMail.Attachments.Add "C:\Test.jpg", olByValue, 2, "Fax Report"
MyMail.Send

Set MyMail = Nothing
Set MyOutlook = Nothing
End Sub

------------------------------------------------------------

Any advise would be appreciated.

-Dave
 
Can you send a JPG via fax from Outlook?

It just seems like it is an Outlook / Faxsoftware inability or configuration issue and not the code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top