I have the following code, it emails, but doesn't include the attachment,
what have I done wrong ?
Code:
Dim bStarted As Boolean
Dim oOutlookApp As Outlook.Application
Dim oItem As Outlook.MailItem
' Check if Outlook is running. If it is not, start Outlook
On Error Resume Next
Set oOutlookApp = GetObject(, "Outlook.Application")
If Err <> 0 Then
Set oOutlookApp = CreateObject("Outlook.Application")
bStarted = True
End If
MsgBox pathstring
Set oItem = oOutlookApp.CreateItem(olMailItem)
With oItem
.Subject = "AFRF" + ClForename + " " + ClSurname
.Body = "Here is your Client Review Feedback"
.Attachments.Add Source:=pathstring, DisplayName:="AFRF"
.To = "jill.pass@christiescare.com"
.Send
End With
' Close Outlook if it was started by this macro.
If bStarted Then
oOutlookApp.Quit
End If
'Clean up
Set oItem = Nothing: Set oOutlookApp = Nothing