Automate sending a Report once a week.

B

Bstclair

I have figured out how to send an report by email, however I'd like the report to go to a group of people every Thursday at 10am. Is this even possible?
 
S

SA

BStClair:

Sure its possible. Create a VBA function with Access to accomplish the
sending of the report as you would normally do. Then stop by our web site
and look in the Code and Design tips area under Reports for the tip on how
to automate output of reports on sample Windows Scripting Host code that you
can set up to run in the Windows Scheduler. You'll need to change the code
to rather than open a report, to run your mail function using the Access
Application.Run method.

HTH
 
T

Tom G.

I was doing a search for help on how to send an e-mail from Access when I ran
across your post. You indicated in your post that you figured out how to
send a report by email. If you could share how you did that it would be very
helpful.

I have two things I want to accomplish. 1. Using VBA send a repot via e-mail
from access if the user clicks a "send report" button. 2.Using VBA or a
Hyperlink from a form that shows a list of e-mail addresses allow the user to
double click a specific e-mail address and launch an e-mail.

I'm self taught in VBA and use Access and VBA quite a bit. All users are
running Ofc 2000 and have Access and Outlook. The e-mail address may be
unique and not in their Outlook address book but will be in the database.

ANything you can offer would be great!
Thanks...
Tom G.
 
P

Pratik

I have similar issue too. I would like to use access to send files
automatically to people and track them. Please let me know if you can provide
more info or share any example codes.

Help is greatly appreciated.
 
M

mega1

Dim stDocName As String

stDocName = "report name"
DoCmd.SendObject acReport, stDocName, acFormatSNP, TheAddress, , ,
"Subject", "massage", False
 
M

Mike

I am attempting to modify your code to send a report through email instead of
print it. Here is what I have tried:

On error resume next
call RunReport("database.mdb","OpenIssues","c:\OpenIssues.snp","Snapshot
Format")

Function RunReport(strDbPathAndName,strRptName,strDocPath,strDocFmt)
On Error Resume Next
Dim objDb
Set objDb = CreateObject("Access.Application")
objDb.Visible=True
objDb.OpenCurrentDatabase (strDbPathAndName)
objDb.DoCmd.SendObject acSendReport, strRptName, strDocFmt, "(e-mail address removed)", , ,
"Open Issues Report",,True
DoEvents
objDb.CloseCurrentDatabase
objDb.Quit
End Function

The database opens, but no email is generated. the sendobject command works
when applied to a command button in access, but seems to do nothing here.

I am using Outlook 2003 and it is always running on my machine so the is no
need to start Outlook in this code.

Any Ideas would be greatly appreciated,
Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top