Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2010
    Posts
    19

    Unanswered: Access 2003 to email in Outlook Express

    Hi,
    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.

    Can anyone help me please ?

    Thanks,

    Graeme

  2. #2
    Join Date
    Jan 2009
    Location
    Kerala, India
    Posts
    183
    Check the following links:

    Ms-Access and Email
    Automated e-mail alerts
    www.MsAccessTips.com (Learn MS-Access Tips & Tricks)
    Learn Advanced MS-Access Programming with sample VBA Code.

    All responses are based on Access 2003/2007

  3. #3
    Join Date
    Mar 2010
    Posts
    19
    Thanks Apr Pillai,

    Hi,

    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 ?

    Cheers,

    Graeme

  4. #4
    Join Date
    Jan 2009
    Location
    Kerala, India
    Posts
    183
    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.
    www.MsAccessTips.com (Learn MS-Access Tips & Tricks)
    Learn Advanced MS-Access Programming with sample VBA Code.

    All responses are based on Access 2003/2007

  5. #5
    Join Date
    Mar 2010
    Posts
    19

    Thanks for the help

    Hi,
    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 !!
    Cheers,
    Graeme

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •