Print Page | Close Window

Report_SendInMailBody.mdb

Printed From: Roger's Access Library
Category: Other Download Libraries
Forum Name: Tejpal, A.D.
Forum Description: A.D. Tejpal's Library
URL: www.rogersaccesslibrary.com/forum/forum_posts.asp?TID=52
Printed Date: 21 Oct 2017 at 10:43pm


Topic: Report_SendInMailBody.mdb
Posted By: A.D. Tejpal
Subject: Report_SendInMailBody.mdb
Date Posted: 07 Jul 2008 at 10:49pm

Report_SendInMailBody
(Updated on 18-Dec-2008)
Sample Db - Explanatory Notes

    This sample db demonstrates sending an access report by placing it in the body of eMail message.

    Though sending a report as an attachment, using DoCmd.SendObject command is pretty straightforward, including it in the body of eMail itself, requires some extra measures.

    Word and Outlook objects are used in this approach and should therefore be available on sender's computer.

    Two styles are covered, one deals with a single report at a time, while the other provides for sending multiple reports as selected in a list box. Temporary output files are stored in folder named ReportOutput located in the same folder as the sample db. This folder gets created programmatically, if not already existing.

    An important feature is the display of horizontal lines in final HTML output by using line markers (*^*) in the report. This  overcomes a well known limitation otherwise faced in transferring lines from access reports to HTML format. Even though  labels with string of hyphens as caption, could be used as replacement for lines, the final results in that case are not quite satisfactory.

    When an access report is converted to HTML format, it translates to one file per page. While concatenating the contents of these files, care has been taken to eliminate unwanted hyperlink labels (First Previous Next Last) appearing at the bottom of each page.

    In each case, two alternative modes for transferring the report to mail body are demonstrated:
    (a) Output the report pages to HTML files (one file per page), read these files, consolidate the content and assign the same to HTMLBody property of outlook application's mail item object.
    (b) Output the report to word file, save it in HTML format, read this file and assign the content to HTMLBody property of outlook application's mail item object. This method is slower than (a) above, mainly on account of the time taken in opening the word application. Moreover, the text alignment and rendering of horizontal lines (through line markers) is not completely  satisfactory. This method is given from an academic point of view only.

    Note: Each time Outlook is used for sending messages programmatically, the user is required to clear a warning message (informing that some program is trying to send a message through Outlook). If manual intervention in this regard is to be circumvented, third party utility like ClickYes could be used.

Reference required:
    (a) Outlook Object Library
    (b) Word Object Library
    (c) Microsoft Scripting RunTime

Version - Access 2000 file format

Download File >>:  http://www.rogersaccesslibrary.com/forum/uploads/37/Report_SendInMailBody.zip - uploads/37/Report_SendInMailBody.zip



-------------
--

Email: mailto:adtejpal@gmail.com - adtejpal@gmail.com



Print Page | Close Window