Hi,
I'm trying to run the code below but I get the error message "Method or data member not found". I have already add the references 'Microsoft Outlook 10.0 Object Library' and 'Microsoft Outlook View Control'. It get hung up at the
'myOLApp.CreateItem(olMailItem)' part of the code.
Thanks for your help. Mike
Private Sub cmdMulti_Click()
Dim myOLItem As Outlook.mailitem
Dim myOLApp As Application
Dim strMessage As String
strMessage = "Hi Mike!"
Set myOLApp = CreateObject("Outlook.Application")
Set myOLItem = myOLApp.CreateItem(olMailItem)
myOLItem.To = "bogus.email@address.com"
myOLItem.Body = strMessage
myOLItem.Subject = "Multiple Attachments"
Set objOutlookAttach = myOLItem.Attachments.Add("C:\Rpt1_54220IPA0000TU.snp")
Set objOutlookAttach = myOLItem.Attachments.Add("C:\Rpt1_54220IPA0004D6.snp")
myOLItem.Send
End Sub
I'm trying to run the code below but I get the error message "Method or data member not found". I have already add the references 'Microsoft Outlook 10.0 Object Library' and 'Microsoft Outlook View Control'. It get hung up at the
'myOLApp.CreateItem(olMailItem)' part of the code.
Thanks for your help. Mike
Private Sub cmdMulti_Click()
Dim myOLItem As Outlook.mailitem
Dim myOLApp As Application
Dim strMessage As String
strMessage = "Hi Mike!"
Set myOLApp = CreateObject("Outlook.Application")
Set myOLItem = myOLApp.CreateItem(olMailItem)
myOLItem.To = "bogus.email@address.com"
myOLItem.Body = strMessage
myOLItem.Subject = "Multiple Attachments"
Set objOutlookAttach = myOLItem.Attachments.Add("C:\Rpt1_54220IPA0000TU.snp")
Set objOutlookAttach = myOLItem.Attachments.Add("C:\Rpt1_54220IPA0004D6.snp")
myOLItem.Send
End Sub