Displaying mail with Excel
Here is what I have for office 2000. Hope it helps
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.to = ""
.CC = ""
.BCC = ""
.Subject = Subj
.Body = Subj
.Attachments.Add ActiveWorkbook.FullName
.Send 'or use .Display
End With
Set OutMail = Nothing
Set OutApp = Nothing
"Santiago" wrote:
I'm trying to open an email from excel with special body, subject, etc etc
and works perfectly with office 2003 (which I have). Sent it to somebdy with
office 2000 and did not work, but changed the reference to an older one, and
worked on both (off XP and off 2000) but it did not on Office XP!!! that was
weird... HELP! HELP!
Here's the code.
Dim myOlapp As New Outlook.Application
Dim myOLItem As Outlook.MailItem
Dim myVar As Integer
Set myOLItem = myOlapp.CreateItem(olMailItem)
myVar = 12
With myOLItem
.Subject = MailSubject
.To = Recipient
.Body = Mailbody
.Attachments.Add Attachment
.Display
End With
|