Access report to Outlook/ Open Outlook and mail report 
Author Message
 Access report to Outlook/ Open Outlook and mail report

I need to take a report from Access and based on  the vendor name
open Outlook and mail the report to correct address which would be stored in
a table.

Report shows all invoices for a vendor.
When the vendor invoice report is run, the output is created as
an attachment  and the unique vendor is tied to an e-mail address which
would be populated in Outlook To:.

Any ideas. I guess what I really need is to understand
the object properties in Outlook.

Please email rather than post.



Wed, 19 Dec 2001 03:00:00 GMT  
 Access report to Outlook/ Open Outlook and mail report

Quote:
> I need to take a report from Access and based on  the vendor name
> open Outlook and mail the report to correct address which would be stored
in
> a table.

...minor snipping...

Quote:
> Any ideas. I guess what I really need is to understand
> the object properties in Outlook.

> Please email rather than post.

For what it's worth, I have to come up with something similar for our
internal customers within the company and would appreciate it if someone
could post the answer as well as emailing Bill.  Many thanks in advance.

Ed



Fri, 21 Dec 2001 03:00:00 GMT  
 Access report to Outlook/ Open Outlook and mail report
It sounds like you have the Access part down but need some help with
Outlook. To create a new mail item in Outlook you need to set a
reference to the Outlook object model and create the following
objects: Application, Namespace, Mapifolder and MailItem.  At that
point you are almost home free. I assume you are outputting your
access report to some common format. I have tested the following
example by outputting a report to an html format with the following
code (done within Access):

 DoCmd.OutputTo acOutputReport, "LawsuitLog", acFormatHTML,
"C:\Goodies\AcCessReport.html", False

The following code will send this report to an e-mail recipient (note,
you can also send just a shortcut if the report is on a network
accessible by your recipient. If so, replace olByValue with
olByReference):

Option Explicit

Private Sub Command1_Click()

  Dim OL As Outlook.Application
  Dim OLNS As Outlook.NameSpace
  Dim MailFolder As Outlook.MAPIFolder
  Dim MyMail As Outlook.MailItem

  Set OL = New Outlook.Application
  Set OLNS = OL.GetNamespace("MAPI")
  Set MailFolder = OLNS.GetDefaultFolder(olFolderInbox)
  Set MyMail = MailFolder.Items.Add

  With MyMail

    .Subject = "Here is that Access Report"
    .Body = "The following report has been attached: "
    .Attachments.Add "C:\Goodies\AccessReport.html", olByValue, 1,
"Access Report"
    .Save
    .Send
  End With

  OL.Quit
  Set OL = Nothing
  Set OLNS = Nothing
  Set MailFolder = Nothing
  Set MyMail = Nothing

End Sub

Keep in mind you may be in a mixed environment with Outlook 97 and 98
clients. If these clients are sending the reports, you may need to
late bind these objects and I recommend using the msoutl8 library, not
msoutl85 just to make sure you are not trying to automate something
not available in Outlook97.

Good luck with your projects and feel free to e-mail me if you have
any questions regading the above.

-Dan Beacom

End Sub


Quote:


>> I need to take a report from Access and based on  the vendor name
>> open Outlook and mail the report to correct address which would be stored
>in
>> a table.

>...minor snipping...

>> Any ideas. I guess what I really need is to understand
>> the object properties in Outlook.

>> Please email rather than post.

>For what it's worth, I have to come up with something similar for our
>internal customers within the company and would appreciate it if someone
>could post the answer as well as emailing Bill.  Many thanks in advance.

>Ed



Fri, 21 Dec 2001 03:00:00 GMT  
 Access report to Outlook/ Open Outlook and mail report
Posted and emailed.

Bill,

There is a db sample that does exactly what you want. I use it myself.

1) go to http://peach.ease.lsoft.com/archives/access-l.html and get a pass
word to search the archives, join the list while you are there, you'll be
glad you did!

2) Do search for "Roger Carlson" in the Subject search field.  Look for the
message announcing his web page  that was posted referring to his sample db
library that is available no charge.

3)After downloading open the EmailingSpecificReports db.

howard

To replay:  remove "_no_spam_"

Quote:
-----Original Message-----

Newsgroups:
microsoft.public.access.chat,microsoft.public.access.developerstoolkit,micro
soft.public.access.modulesdaovba,microsoft.public.outlook,microsoft.public.o
utlook97,microsoft.public.vb.database,microsoft.public.vb.ole.automation
Date: Saturday, July 03, 1999 11:26 PM
Subject: Access report to Outlook/ Open Outlook and mail report

>I need to take a report from Access and based on  the vendor name
>open Outlook and mail the report to correct address which would be stored
in
>a table.

>Report shows all invoices for a vendor.
>When the vendor invoice report is run, the output is created as
>an attachment  and the unique vendor is tied to an e-mail address which
>would be populated in Outlook To:.

>Any ideas. I guess what I really need is to understand
>the object properties in Outlook.

>Please email rather than post.


>I need to take a report from Access and based on  the vendor name
>open Outlook and mail the report to correct address which would be stored
in
>a table.

>Report shows all invoices for a vendor.
>When the vendor invoice report is run, the output is created as
>an attachment  and the unique vendor is tied to an e-mail address which
>would be populated in Outlook To:.

>Any ideas. I guess what I really need is to understand
>the object properties in Outlook.

>Please email rather than post.



Thu, 27 Dec 2001 03:00:00 GMT  
 Access report to Outlook/ Open Outlook and mail report
Sorry, I gave up on the ListServe idea after about 1/2 an hour.  That has
got to be the most convulated, paranoid, secretive,
pain-in-the-butt-clique-bureaucratic-web-site/club I have been to in a LONG
time.

I was interested in the answer, but not enough to sacrifice my sanity......

By the way, am still waiting on an answer from ListServ.....

Dan Colgan



Sat, 29 Dec 2001 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Access report to Outlook/ Open Outlook and mail report

2. E-mailing Crystal 7 Reports from VB 6.0 using Outlook

3. Error sending report via Access / Outlook Express

4. How can I send an Access report to Outlook 97 by VBA

5. Faxing an Access report using Outlook

6. Running an Access Report from an Outlook Form

7. Accessing Crystal Reports from Outlook

8. Access Report to Excel to Outlook

9. VB, Access, OutLook, Reports, WebDevelopment and more

10. Creating mail accounts for Outlook/Outlook Express using VB

11. how to open outlook new mail in foreground using activex

12. open Outlook Mail-Dialog

 

 
Powered by phpBB® Forum Software