Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Method or data member not found

Status
Not open for further replies.

legolas75

Technical User
Mar 19, 2007
17
US
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top