Hi all,
I have the following code (taken from a post found in the search facility):
Dim appOutl As Object
Dim MyNameSpace As Object
Dim myemail As Object
Set appOutl = CreateObject("Outlook.Application")
Set MyNameSpace = appOutl.getNameSpace("MAPI")
Set myemail = appOutl.CreateItem(0)
myemail.to = "someone@someone.com"
myemail.Subject = "THIS IS AN AUTOMATED TEST"
myemail.body = "THIS IS THE BODY OF THE EMAIL MESSAGE"
myemail.Attachments.Add "c:\something.txt", 1, 5520, "frunlog.txt"
myemail.Send
I was wondering how I attach a report in ".rtf" format to this email?
For example, a report that I would like to attach I might open from a command button with the following code:
DoCmd.OpenReport "Drivers Report", acPreview, "[ID] = " & Me.ID
I would want to attach this report (filtered with the link criteria) as an rtf attachment to my email message.
I have also noticed that outlook will not automatically send the email, it will remain in the outbox until I click send and receive within outlook. Is there any way to get around this?
Thanks for any help....
Peter
I have the following code (taken from a post found in the search facility):
Dim appOutl As Object
Dim MyNameSpace As Object
Dim myemail As Object
Set appOutl = CreateObject("Outlook.Application")
Set MyNameSpace = appOutl.getNameSpace("MAPI")
Set myemail = appOutl.CreateItem(0)
myemail.to = "someone@someone.com"
myemail.Subject = "THIS IS AN AUTOMATED TEST"
myemail.body = "THIS IS THE BODY OF THE EMAIL MESSAGE"
myemail.Attachments.Add "c:\something.txt", 1, 5520, "frunlog.txt"
myemail.Send
I was wondering how I attach a report in ".rtf" format to this email?
For example, a report that I would like to attach I might open from a command button with the following code:
DoCmd.OpenReport "Drivers Report", acPreview, "[ID] = " & Me.ID
I would want to attach this report (filtered with the link criteria) as an rtf attachment to my email message.
I have also noticed that outlook will not automatically send the email, it will remain in the outbox until I click send and receive within outlook. Is there any way to get around this?
Thanks for any help....
Peter