mikechambers
Active Member
- Joined
- Apr 27, 2006
- Messages
- 397
My master code is in Excel. But part of my code opens up Word and does some things. I have used email automation within Excel, and am trying to utilize the same principles in the Word section, but it's not working. I am using Word 2003.
Dim olApp As Outlook.Application
Dim olMail As Outlook.MailItem
Set olApp = CreateObject("Outlook.Application")
Set olMail = olApp.CreateItem(0)
olMail.BCC = "name@yahoo.com
olMail.Subject = "This is the subject"
olMail.Body = "This is the body"
olMail.Send
Set olApp = Nothing
Set olMail = Nothing
The part that says "This is the body" is where I want the body to be the actual Word document. So I don't want to send the document as an attachment, but rather IN the body of the email. Just as it would do if I chose File, Send To, Mail Recipient from the menus. How can I grab the document contents and put it into the body of the email?
Dim olApp As Outlook.Application
Dim olMail As Outlook.MailItem
Set olApp = CreateObject("Outlook.Application")
Set olMail = olApp.CreateItem(0)
olMail.BCC = "name@yahoo.com
olMail.Subject = "This is the subject"
olMail.Body = "This is the body"
olMail.Send
Set olApp = Nothing
Set olMail = Nothing
The part that says "This is the body" is where I want the body to be the actual Word document. So I don't want to send the document as an attachment, but rather IN the body of the email. Just as it would do if I chose File, Send To, Mail Recipient from the menus. How can I grab the document contents and put it into the body of the email?