G
Guest
Hi, I would like some help with creating an e-mail with macro. I have a macro
to create an e-mail, and I want that the body of the e-mail come from a .doc
file.
Any help?
By the way, here it is the simple following macro to do this:
Sub CreateMail()
Dim olApp As Outlook.Application
Dim objMail As Outlook.MailItem
Set olApp = Outlook.Application
Set objMail = olApp.CreateItem(olMailItem)
With objMail
.Display
.Subject = "Test"
.Importance = olImportanceHigh
.ReadReceiptRequested = True
.Sensitivity = olNormal
.Attachments.Add ("C:\Documents and Settings\Desktop\Test.txt")
.To = "(e-mail address removed)"
.Body = "Can I use MsWord?"
.Save
End With
End Sub
An easy question: how do I do to close the objMail?
objMail.Close is not working
Thanks on advance,
Marcelo
to create an e-mail, and I want that the body of the e-mail come from a .doc
file.
Any help?
By the way, here it is the simple following macro to do this:
Sub CreateMail()
Dim olApp As Outlook.Application
Dim objMail As Outlook.MailItem
Set olApp = Outlook.Application
Set objMail = olApp.CreateItem(olMailItem)
With objMail
.Display
.Subject = "Test"
.Importance = olImportanceHigh
.ReadReceiptRequested = True
.Sensitivity = olNormal
.Attachments.Add ("C:\Documents and Settings\Desktop\Test.txt")
.To = "(e-mail address removed)"
.Body = "Can I use MsWord?"
.Save
End With
End Sub
An easy question: how do I do to close the objMail?
objMail.Close is not working
Thanks on advance,
Marcelo