Unanswered: Access 2003 to email in Outlook Express
I'm looking for way of sending a report automatically to Windows Live Mail (default email) or to Outlook Express.
I am using access 2003, and already have the report converting to .pdf using vba code fron Stephen Lebans. This code saves the report as c:\MyPDF\Jessie.pdf
I am looking for vba code to send the attachment Jessie.pdf to Outlook express, with a subject line of "Your Rota For Next Week" and subject line of "Hi Jessie, ....".
I would also like the recipient to be added automatically with the code.
I've got it working now, 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 ?
If you want to use Week Number and Employee Name as criteria to your Report Query then I think the best option is to create two Textboxes on a Form to enter these values into them and use the textbox references (like Forms!myEmailForm![WeekNum]) in the criteria section of the Query.
After settings up these values on the Form, launch the Email sending procedure from a Command Button Click Event procedure.
In the Command Button Click Event Procedure write the statement Me.Refresh to inform the Report Query to use the new value that you entered on the Textboxes to filter data for the Report, before launching the Report in the Email Program.
Thanks for that, sounds like a great idea, I'll give it a go. All this is new to me but I'm seeing how powerful VBA is and how much time this can save if applied properly.
The learning curve keeps on growing !!