This will work if you are using Outlook:
Sub SendMail()
Dim OL As Object, MailSendItem As Object
Set OL = CreateObject("Outlook.Application")
Set MailSendItem = OL.CreateItem(olMailItem)
With MailSendItem
.Subject = "Test"
.Body = "Testing 1,2,3"
.To = "bob@bob.com; sam@sam.com"
.Attachments.Add ("C:\File.txt")
.Send
End With
End Sub
How about if I'm using Outlook Express?
It's giving me an error, #429 "ActiveX Component can't create object"
Is there a way to use Express?
I'm sure there is...however, I don't have Express so I can't say for sure. Check to see that you have references set up for OLE Automation. You can find this under Tools|References in the VBE. Anybody else have any thoughts???
Chris
I have Outlook Express 5.0 in the reference (MSOE.dll) but now I need to figure out how to write it to use Express... what to replace
'Set OL = CreateObject("Outlook.Application")' with....