Welcome to UtterAccess! Active Topics. Search this forum only? More Search Options. Please Wait Site Message.
|Published (Last):||13 November 2015|
|PDF File Size:||9.3 Mb|
|ePub File Size:||6.88 Mb|
|Price:||Free* [*Free Regsitration Required]|
Download a free trial today. Microsoft Access is a powerful tool for handling data and creating report forms.
With the emergence of the Internet as a major factor in all business application, it has become vital to have connectivity in all spheres.
Herein the various products, their inventory levels and the reorder level are stored. On a product reaching reorder level, a Form letter to the supplier is generated. Wouldn't it be more convenient if an email were generated directly from the application? Embed it in your report and on click of a button an email will be generated directly from the application.
The SendObject action can attach a MS Access form, table, report or query in an electronic mail message. All these attachments can be read and forwarded too. The subject line is Bank Payment and the body is blank. This mail is not opened for editing. In an application, this code can be attached to the onClick event of a Command Button. The arguments like To, cc, bcc can be selected from drop down lists in a form. The object attached, say a letter to a supplier, can be a report with run time variables.
Hopefully this example explains the Send Object action clearly. This is also to be selected when there is no attachment. Name This string expression is a valid name for the object type declared above.
If the object is to be incorporated in the mail message, define the type argument and leave the name blank Format This is the format of the output for the attached object. A semicolon separates the addresses ;. If the mail application does not recognize these email addresses, the application throws an error and the mail is not sent. If this argument is left blank Microsoft Access prompts you for it. When left blank, the cc line in the mail message is blank. When left blank, the bcc line in the mail message is blank.
Subject This string expression shows the matter to be depicted in the Subject line of the mail. Body This is the main message text of the mail. If an object is included, this message comes after the object is displayed. When left blank only the attached object is mailed. Edit This toggle argument denotes whether the email message can be edited before sending. To open the electronic mail application with the message loaded, select True False 0 is used when the message is not to be edited.
The default is True. Templatefile This string expression has the full path and name of the file containing the template for a HTML file. Now we have the complete syntax. Let us see an example: DoCmd. This is the type of the object attached to the mail. This string expression is a valid name for the object type declared above. If the object is to be incorporated in the mail message, define the type argument and leave the name blank.
This is the format of the output for the attached object. This string expression shows the matter to be depicted in the Subject line of the mail. This is the main message text of the mail. This toggle argument denotes whether the email message can be edited before sending. This string expression has the full path and name of the file containing the template for a HTML file.
DoCmd.SendObject method (Access)
Sending emails from Microsoft Access databases is a very powerful feature. Disseminating data and reports to your contacts can significantly improve your service and communications, and save paper and postage. SendObject method. This works for simple emails, but it also has significant limitations. Discuss this further in our blog. The syntax information comes from the Microsoft VBA online help system with additional edits for clarification.
SendObject in Microsoft Access
You can use the SendObject action to include the specified Microsoft Access datasheet, form, report, module, or data access page in an electronic mail message, where it can be viewed and forwarded. Download Access example of the Sendobject Method. If you leave both the objecttype and objectname arguments blank the default constant, acSendNoObject, is assumed for the objecttype argument , Microsoft Access sends a message to the Email application without an included database object. If you run Visual Basic code containing the SendObject method in a library database, Microsoft Access looks for the object with this name first in the library database, then in the current database. To — An optional string expression that lists the recipients whose names you want to put on the To line in the E-mail message. Separate the recipient names you specify in this argument and in the cc and bcc arguments with a semicolon ; or with the list separator set on the Number tab of the Regional Settings Properties dialog box in Windows Control Panel.
Access & Email
Sending Email from Access using Docmd.sendobject