I'm sending a file via this code...
Dim olkapps As Outlook.Application
Dim olknamespaces As Outlook.NameSpace
Dim objmailitems As Outlook.MailItem
Set olkapps = New Outlook.Application
Set olknamespaces = GetNamespace("MAPI")
Set objmailitems = olkapps.CreateItem(olMailItem)
With objmailitems
.To = NameRef
.Subject = "Subject Title"
.Body = "Text In Here"
.Importance = olImportanceHigh
.Attachments = "C:\My File Name"
.Send
End With
Set objmailitems = Nothing
Set olknamespaces = Nothing
Set olkapps = Nothing
The problem is with the .Attachments. I keep getting a runtime error which states the parameter value is not valid. I'm sure the path is valid. Is there something I'm not catching here?
Dim olkapps As Outlook.Application
Dim olknamespaces As Outlook.NameSpace
Dim objmailitems As Outlook.MailItem
Set olkapps = New Outlook.Application
Set olknamespaces = GetNamespace("MAPI")
Set objmailitems = olkapps.CreateItem(olMailItem)
With objmailitems
.To = NameRef
.Subject = "Subject Title"
.Body = "Text In Here"
.Importance = olImportanceHigh
.Attachments = "C:\My File Name"
.Send
End With
Set objmailitems = Nothing
Set olknamespaces = Nothing
Set olkapps = Nothing
The problem is with the .Attachments. I keep getting a runtime error which states the parameter value is not valid. I'm sure the path is valid. Is there something I'm not catching here?