SEARCH

The How-To Geek Forums Have Migrated to Discourse

How-To Geek Forums / Geek Stuff

Send a report from Access 2003 as email (with attachment) using Outlook Express

(3 posts)
  • Started 1 year ago by graeme706
  • Latest reply from moreeg
  • Topic Viewed 498 times

graeme706
Posts: 2

Hi,
I'm using Access 2003 and would like to send a report as a pdf file using email (outlook express).
So far, I have used VBA code from Stephen Lebans which converts the report to pdf and saves it as c:\MyPDF\Jessie.pdf

What I'd like to do now is have access run some VBA code to send the file (Jessie.pdf) to email recipient, with a pre-written subject lime and body.

Is this possible ? How would I find the code ?

Thanks,

Graeme

Posted 1 year ago
Top
 
graeme706
Posts: 2

Hi,

Hi,

I got it working, seems that Outlook Express will not handle any automated input, so I've switched to Outlook.

I've got the Access 2k3 report converting to pdf and sending to email which is great, saved alot of previous repetitive work.

Just one last thing - just a wee something that would put the icing on the cake:- The report which is called upon the VBA code has a couple of inputs, basically I have to input the Week_Number and the Employee_Name. If I was to create VBA code per employee, how could I include the employee name within the code so that I could just the the piece of code and have the employee name automatically input to the report ?

Cheers,

Graeme

Posted 1 year ago
Top
 
moreeg
Posts: 842

As "wee" things go this might be a wee bit bigger than that. Here are a couple of suggestions;

If you are creating a separate macro for each employee then you could simply hard code their name into the macro. But this seems to be a less than optimal solution. What happens when new employees join or they leave. It would be a support nightmare.

Depending on how you run this report i.e. the trigger for the report, why wouldn't you create a view of employee names and loop through that to pick up each employee? Perhaps the same view could be used to provide the week number as well so that you can dispense with that manual input at the same time.

Posted 1 year ago
Top
 



Topic Closed

This topic has been closed to new replies.