Klartigue
08-29-2013, 12:42 PM
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("FIDELITY FTO IMPORT FOLDER")
oRecipient.Type = 1
.Subject = "test"
.body = "Please see." & vbNewLine & vbNewLine & _
"Let me know if you need anything else." & vbNewLine & vbNewLine & _
"Thanks, " & vbNewLine & vbNewLine & _
"kl " & vbNewLine & _
"kl " & vbNewLine & _
"test" & vbNewLine & vbNewLine & _
"The ."
If Dir(FILE_ATTACH, vbNormal) <> "" Then
.Attachments.Add ("G:\KL\Allocations\FTO CSV UPLOAD\Fidelity Trades.csv")
.Save
End If
End With
End Sub
I have the above code in which I try to email with an attachment. I get an error saying mismatch. I have never emailed with a csv attachement..I am wondering if part of this refers to excel and not csv? If Dir(FILE_ATTACH, vbNormal) <> "" Then
Do you see where the mismatch error could be?
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("FIDELITY FTO IMPORT FOLDER")
oRecipient.Type = 1
.Subject = "test"
.body = "Please see." & vbNewLine & vbNewLine & _
"Let me know if you need anything else." & vbNewLine & vbNewLine & _
"Thanks, " & vbNewLine & vbNewLine & _
"kl " & vbNewLine & _
"kl " & vbNewLine & _
"test" & vbNewLine & vbNewLine & _
"The ."
If Dir(FILE_ATTACH, vbNormal) <> "" Then
.Attachments.Add ("G:\KL\Allocations\FTO CSV UPLOAD\Fidelity Trades.csv")
.Save
End If
End With
End Sub
I have the above code in which I try to email with an attachment. I get an error saying mismatch. I have never emailed with a csv attachement..I am wondering if part of this refers to excel and not csv? If Dir(FILE_ATTACH, vbNormal) <> "" Then
Do you see where the mismatch error could be?