diddi
Well-known Member
- Joined
- May 20, 2004
- Messages
- 3,337
- Office Version
- 2010
- Platform
- Windows
greets all. i have come across my first difficulty using xl2010... this code based on ronDB's code has worked for me for ages, but under 2010 it falls over here:
OlMail.Recipients.Add ToRecipient
has the object model changed? i couldnt find anything at msdn.
TIA
OlMail.Recipients.Add ToRecipient
has the object model changed? i couldnt find anything at msdn.
TIA
Code:
' emailName is a Public string
Dim OlApp As Object, OlMail As Object
Dim ToRecipient As Variant
Set OlApp = CreateObject("Outlook.Application")
Set OlMail = OlApp.createitem(olmailitem)
For Each ToRecipient In Array(emailName)
OlMail.Recipients.Add ToRecipient
Next ToRecipient
OlMail.Subject = Label2.Caption & " from me"
OlMail.body = "Please find attached invoice." & Chr(13) & "my name"
OlMail.Attachments.Add "D:\My Invoices\" & Label2.Caption & ".pdf"
OlMail.Send