Results 1 to 3 of 3
  1. #1
    danial.a is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Sep 2015
    Location
    Iran
    Posts
    2

    convert a report to HTML using a template

    Hello all,
    i have a report with report header and page header and detail sections.i want to convert it to HTML in order to publish it via email.
    i use DoCmd.OutputTo acOutputReport, "Report1", acFormatHTML, "C:\Users\Danial\Desktop\report1.HTML", False, , UTF - 8 and it's converted.
    but none of original report format such as borders around textboxes and labels are shown in HTML file.also HTML file is disordered and texts shown
    in incorrect positions and have not good view.i want to HTML file have good view and format such as border and background color.
    i tried to format it with a template HTML file using HTML tags but none of them took affected in converted HTML file and result is same as before.
    i googled a lot to find HTML templates to use for convert access report but found nothing!
    any help is highly appreciated!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    just send it via 1 statement:
    DoCmd.SendObject acSendReport, "rptMyRpt", acFormatPDF, sTo, , , sSubj, sMsg
    or
    DoCmd.SendObject acSendReport, "rptMyRpt", acFormatHTML, sTo, , , sSubj, sMsg

  3. #3
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I have always created an HTML file using editors like DreamWeaver or FrontPage. I would then translate that code into VBA. With the HTML translated, you can insert it onto the body of your email while automating Outlook. The trick is to concatenate variables with the HTML.

    Otherwise, you will always have difficulties with Access Controls, Lines, etc not getting translated during the export process.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 11
    Last Post: 06-28-2015, 10:46 AM
  2. Macro - Output to html using a template
    By thudson in forum Access
    Replies: 1
    Last Post: 04-05-2013, 12:15 AM
  3. Creation Time in HTML template
    By alexalex in forum Import/Export Data
    Replies: 0
    Last Post: 12-13-2012, 03:27 AM
  4. Report Sent as HTML Body - multiple pages
    By chris.williams in forum Reports
    Replies: 3
    Last Post: 09-15-2012, 07:18 PM
  5. Access 2003 - Export Report to HTML
    By darth.pathos in forum Import/Export Data
    Replies: 0
    Last Post: 03-20-2010, 01:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums