Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Jan 2010
    Location
    Oregon
    Posts
    61
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Use Access table data for body of Outlook email?

    I have data in Access 2010 that I would like to email to respective recipients. However, I would like it to appear in grid/table format like the attached image. Can this be done? If not, what's the best way to proceed using Office 2010? I know Access very well, but not Excel. I know how to automate the creation of an Outlook email via automation, but using a variable number of table rows with some formatting as the body is stumping me. Any details appreciated.
    Sample.jpg

  2. #2
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,433
    Thanks
    371
    Thanked 1,456 Times in 1,325 Posts
    Reid,

    If you display your query then go to the External Data tab of the ribbon and select Email it will do what you want.
    I'm also sure you can control this from VBA if needed. HTH
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  3. #3
    3 Star Lounger HiTechCoach's Avatar
    Join Date
    Sep 2011
    Location
    Oklahoma City, OK
    Posts
    200
    Thanks
    0
    Thanked 31 Times in 30 Posts
    I do this using VBA and Outlook automation. The key is to set the body type to HTML. I loop trough a recordset and write the data into the email body using HTML Table tags to create the grid. You can use HTML formatting tags as needed. As long as the recipient can handle HTML formated emails you will be fine.

    Another option I like to use is Excel automation. I create an Excel Workbook (.xls/.xlsx) with the desired information and formatting. The Excel workbook is sent as an attachment to an email message.
    Boyd Trimmell aka HiTechCoach (Access Information here)
    Microsoft MVP - Access Expert
    "If technology doesn't work for people, then it doesn't work."

  4. The Following User Says Thank You to HiTechCoach For This Useful Post:

    Reid (2013-05-06)

  5. #4
    Star Lounger
    Join Date
    Jan 2010
    Location
    Oregon
    Posts
    61
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Thank you for this info. I had thought about creating HTML via VBA, but wasn't sure if I was on the right track.

    Regarding the email, I wish that was an option, but it does so as an attachment and management wants the info directly in the body of the email.

Posting Permissions

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