9780135088357 ACS C09 MS11 - Pearson...

4
= Copyright © 2011 by Pearson Education Inc. publishing as Prentice Hall. All rights reserved. From Skills for Success with Microsoft® Access 2010 Comprehensive Build Macros and Write VBA Procedures | Microsoft Access Chapter 9 More Skills: SKILL 11 | Page 1 of 4 A macro can be created that sends reports via e-mail by exporting the report to Microsoft Outlook. To complete this project, Outlook needs to be installed and configured to work with your e-mail account. To complete this database, you will need the following file: a09_Outings You will save your files as: Lastname_Firstname_a09_Outings Lastname_Firstname_a09_Outings_Snip 1. Start Access and open the student data file a09_Outings. Click the File button, and then save the file as an Access Database in your Access Chapter 9 folder with the name Lastname_Firstname_a09_Outings If necessary, enable the content. 2. Display the Create tab, and then in the Macros & Code group, click the Macro button. 3. In the macro, click the Add New Action box arrow, and then click EMailDatabaseObject. 4. Click the Object Type arrow, and then click Report. 5. Click the Object Name arrow, and then click Outings. Compare your screen with Figure 1. Access CHAPTER 9 More Skills 11 Build Macros that Send Reports via E-Mail Figure 1 EMailDatabaseObject action EMailDatabaseObject action arguments

Transcript of 9780135088357 ACS C09 MS11 - Pearson...

Page 1: 9780135088357 ACS C09 MS11 - Pearson Educationwps.prenhall.com/.../9780135088357_ACS_C09_MS11.pdfStart Access and open the student data file a09_Outings. Click the File button, and

=

Copyright © 2011 by Pearson Education Inc. publishing as Prentice Hall. All rights reserved.From Skills for Success with Microsoft® Access 2010 Comprehensive

Build Macros and Write VBA Procedures | Microsoft Access Chapter 9 More Skills: SKILL 11 | Page 1 of 4

� A macro can be created that sends reports via e-mail by exporting the report to MicrosoftOutlook.

� To complete this project, Outlook needs to be installed and configured to work with youre-mail account.

To complete this database, you will need the following file:� a09_Outings

You will save your files as:� Lastname_Firstname_a09_Outings� Lastname_Firstname_a09_Outings_Snip

1. Start Access and open the student data file a09_Outings. Click the File button,and then save the file as an Access Database in your Access Chapter 9 folder with the name Lastname_Firstname_a09_Outings If necessary, enable the content.

2. Display the Create tab, and then in the Macros & Code group, click the Macro button.

3. In the macro, click the Add New Action box arrow, and then click EMailDatabaseObject.

4. Click the Object Type arrow, and then click Report.

5. Click the Object Name arrow, and then click Outings. Compare your screen with Figure 1.

AccessCHAPTER 9

More Skills 11 Build Macros that Send Reports via E-Mail

Figure 1

EMailDatabaseObjectaction

EMailDatabaseObjectaction arguments

Page 2: 9780135088357 ACS C09 MS11 - Pearson Educationwps.prenhall.com/.../9780135088357_ACS_C09_MS11.pdfStart Access and open the student data file a09_Outings. Click the File button, and

Copyright © 2011 by Pearson Education Inc. publishing as Prentice Hall. All rights reserved.From Skills for Success with Microsoft® Access 2010 Comprehensive

6. Click the Output Format arrow, and then click Rich Text Format (*.rtf).

With the Rich Text Format, the e-mail message will retain most of the formatting inthe Access report.

7. In the To box, type your own e-mail address. If asked by your instructor, in the Cc box, typeyour instructor’s e-mail address.

8. In the Subject box, type Outings Report from Chapter 9 Compare your screen with Figure 2.

Build Macros and Write VBA Procedures | Microsoft Access Chapter 9 More Skills: SKILL 11 | Page 2 of 4

Figure 2

E-Mail address

Subject

Page 3: 9780135088357 ACS C09 MS11 - Pearson Educationwps.prenhall.com/.../9780135088357_ACS_C09_MS11.pdfStart Access and open the student data file a09_Outings. Click the File button, and

9. In the Message Text box, type Dear Todd, Please review our latest outings. If you have anyquestions, then please do not hesitate to contact Julia Wagner at (809) 555-1015 or [email protected]

10. In the macro, click the Add New Action box arrow, and then click Comment. In theComment box, type Created by Your Name

11. Click Save , type E-Mail_Outings_Report and then click OK. Compare your screen withFigure 3.

Copyright © 2011 by Pearson Education Inc. publishing as Prentice Hall. All rights reserved.From Skills for Success with Microsoft® Access 2010 Comprehensive

Build Macros and Write VBA Procedures | Microsoft Access Chapter 9 More Skills: SKILL 11 | Page 3 of 4

Figure 3

Message

Comment

Page 4: 9780135088357 ACS C09 MS11 - Pearson Educationwps.prenhall.com/.../9780135088357_ACS_C09_MS11.pdfStart Access and open the student data file a09_Outings. Click the File button, and

12. On the Design tab, in the Tools group, click Convert Macros to Visual Basic. ClickConvert, and then click OK.

13. In the Project Explorer, double-click Converted Macro-E-mail_Outings_Report. If youare printing this project, from the File menu, click Print.

14. From the File menu, click Close and Return to Microsoft Access.

15. On the Design tab, in the Tools group, click Run. Wait a few moments for the macro toprepare the message and for Outlook to display an e-mail window. If an error message displays, Outlook may not be configured to work with your e-mail address. If so, close allmessages.

16. In the Outlook E-mail window, click the Send button.

17. In Access, Close the macro, and then Exit Access.

18. Submit your files as directed by your instructor.

� You have completed More Skills 11

Copyright © 2011 by Pearson Education Inc. publishing as Prentice Hall. All rights reserved.From Skills for Success with Microsoft® Access 2010 Comprehensive

Build Macros and Write VBA Procedures | Microsoft Access Chapter 9 More Skills: SKILL 11 | Page 4 of 4