Automate sending a report snapshot in e-mail
- Create a macro.
- In the Database window, click Macros under Objects.
- Click the New button on the Database window toolbar.
- Add an action to the macro.
- In the Macro window, click the first empty row in the Action column. If you want to insert an action between two action rows, click the selector for the action row just below the row where you want to insert the new action, and then click Insert Row on the toolbar.
- In the Action column, click the arrow to display the action list.
- Click the action you want to use.
- In the lower part of the window, specify arguments for the action, if any are required. For action arguments whose settings are a database object name, you can set the argument by dragging the object from the Database window to the action's Object Name argument box.
- Type a comment for the action. Comments are optional.
- To add more actions to the macro, move to another action row and repeat step 3. Microsoft Access carries out the actions in the order you list them.
- Add the SendObject action to the macro. For example:
Argument Value Object Type Report Object Name Summary of Sales by Quarter Output Format Snapshot Format To All Northwind Traders; Shareholders Cc none Bcc none Subject Quarterly Sales report Message Text This is our best quarter in years! Edit Message No - Run the macro each time you want to send the report snapshot.
To run a macro directly, do one of the following:
- To run a macro from the Macro window, click Run on the toolbar.
- To run a macro from the Database window, click Macros and then double-click a macro name.
- On the Tools menu, point to Macro, click Run Macro, and then select the macro from the Macro Name list. Then click a macro in the Macro Name box.
- Run a macro from a Microsoft Visual Basic procedure by using the RunMacro method of the DoCmd object.