PDA

View Full Version : Solved: Fax



Klartigue
04-18-2012, 01:04 PM
Ok, I signed up to get an internet fax service.

This would be the vba
Sub Fax()

ActiveWorkbook.SendFaxOverInternet _
"17132382051@rcfax.com", _
"Please process the enclosed trade ticket. Thanks, Katherine Lartigue ", True

End Sub


Instead of emailing the message in my drafts..see vba code below that attaches an excel doc to an email and saves it in my draft, how do tell it to fax the email with the attachment instead of emailing it?

Sub EmailFidelity()
Dim oOutlook As Object
Dim oMailItem As Object
Dim oRecipient As Object
Dim oNameSpace As Object
Dim Lastrow As Long
Dim bodyText As String
Dim i As Long


Set oOutlook = CreateObject("Outlook.Application")
Set oNameSpace = oOutlook.GetNameSpace("MAPI")
oNameSpace.Logon , , True


Set oMailItem = oOutlook.CreateItem(0)

With oMailItem

Set oRecipient = .Recipients.Add("klartigue@avalonadvisors.com")
oRecipient.Type = 1

.Subject = "Avalon Trade Allocations Attached"

.body = "Please see the attached trade allocations." & vbNewLine & vbNewLine & _
"Let me know if you need anything else." & vbNewLine & vbNewLine & _
"Thanks, " & vbNewLine & vbNewLine & _
"Katherine Lartigue " & vbNewLine & _
"klartigue@avalonadvisors.com 713-238-2088"

.Attachments.Add ("G:\Katherine Lartigue\Allocations\Fidelity Trades.xls")
.Save
End With

End Sub

Klartigue
04-18-2012, 01:06 PM
But i still want the email saved in my drafts.. But just instead of the email address i want the fax #@rcfax.com so maybe i make the recipient part of the code..

Set oRecipient = .Recipients.Add("17132382051@rcfax.com", _ )

Im not sure, thanks for the help!

Klartigue
04-18-2012, 01:57 PM
I tried the below and it seems to work just fine for faxing.

Sub EmailMellon()
Dim oOutlook As Object
Dim oMailItem As Object
Dim oRecipient As Object
Dim oNameSpace As Object
Dim Lastrow As Long
Dim bodyText As String
Dim i As Long


Set oOutlook = CreateObject("Outlook.Application")
Set oNameSpace = oOutlook.GetNameSpace("MAPI")
oNameSpace.Logon , , True


Set oMailItem = oOutlook.CreateItem(0)

With oMailItem

Set oRecipient = .Recipients.Add("17132382051@rcfax.com")
oRecipient.Type = 1

.Subject = "Avalon Trade Allocations Attached"

.body = "Please see the attached trade allocations." & vbNewLine & vbNewLine & _
"Let me know if you need anything else." & vbNewLine & vbNewLine & _
"Thanks, " & vbNewLine & vbNewLine & _
"Katherine Lartigue " & vbNewLine & _
"klartigue@avalonadvisors.com 713-238-2088"

.Attachments.Add ("G:\Katherine Lartigue\Allocations\Bank of New York Mellon Trades.xls")
.Save
End With

End Sub

Is there a way i can attach a cover page to this fax? The coverpage is located at G:\Charles Luke\Back Office\Fax Covers\BNY fax cover