comebakqueen
New Member
- Joined
- Jan 20, 2014
- Messages
- 8
Hey Guys!
I 've recently created this awesome serious of Macro's to automate the distribution of a monthly report but am getting stuck on the last code which happens to be in Outlook (where you can’t record Macro’s)!
I’ve set up the code to create a draft for the supplier, insert the e-mails and attachments but I can’t figure out how to add an OLE Object (from a file) in to make up the body!
The code is here:
Sub DIFOT_Mailout()
Dim myOutlook As Outlook.Application
Dim objMailMessage As Outlook.MailItem
Set myOutlook = Outlook.Application
Set objMailMessage = myOutlook.CreateItem(0)
With objMailMessage
.To = "Person1; Person2"
.CC = "Team1; Team2"
.Subject = "Bidvest DIFOT Results for January 2014"
.Body = ""
.Attachments.Add ("R:\Operations\Australia\Reports\DIFOT\Supplier Reports\Document1")
.Attachments.Add ("R:\Operations\Australia\Reports\DIFOT\Supplier Reports\Document2")
.Display
.Save
.Close olPromptForSave
End With
End Sub
Can anyone help out?
Cheers,
Tams =D
I 've recently created this awesome serious of Macro's to automate the distribution of a monthly report but am getting stuck on the last code which happens to be in Outlook (where you can’t record Macro’s)!
I’ve set up the code to create a draft for the supplier, insert the e-mails and attachments but I can’t figure out how to add an OLE Object (from a file) in to make up the body!
The code is here:
Sub DIFOT_Mailout()
Dim myOutlook As Outlook.Application
Dim objMailMessage As Outlook.MailItem
Set myOutlook = Outlook.Application
Set objMailMessage = myOutlook.CreateItem(0)
With objMailMessage
.To = "Person1; Person2"
.CC = "Team1; Team2"
.Subject = "Bidvest DIFOT Results for January 2014"
.Body = ""
.Attachments.Add ("R:\Operations\Australia\Reports\DIFOT\Supplier Reports\Document1")
.Attachments.Add ("R:\Operations\Australia\Reports\DIFOT\Supplier Reports\Document2")
.Display
.Save
.Close olPromptForSave
End With
End Sub
Can anyone help out?
Cheers,
Tams =D