Microsoft Excel
Good programming techniques exercise
Relatively easy

This Microsoft Excel GOOD PROGRAMMING TECHNIQUES exercise is provided to allow potential course delegates to assess their suitability for the Wise Owl ADVANCED VISUAL BASIC FOR APPLICATIONS course only, and may not be reproduced in whole or in part in any format without the prior written consent of Wise Owl.

Exercise: Creating Outlook message with CC addresses

A full answer to this exercise is provided as part of the training course!

1) In Word, create a document and type in some text (your name would do fine).
2) Write a macro which will create a message in Outlook composed of the text in your document and send it to:
  • The person whose email address you pass in as an argument (the TO address); and
  • Optionally, the person whose email address you pass in as an optional argument (the CC address).
3) You may find the following excerpt of code helpful:
Exercise screen-shot 652 You will need to reference the Microsoft Outlook application first
4) Now write another macro which works in exactly the same way, but to which you can pass as many CC addresses as you want (including none at all) using ParamArray.
5) Save this document as Document which emails itself.doc, then close it down.

Thank you for showing an interest in this Advanced Visual Basic for Applications training course! As mentioned above, full answers to this and other exercises are provided on the course. On all Wise Owl scheduled courses delegates can take away these model answers (together with their own efforts!) on a free USB stick.

All content � Wise Owl Business Solutions Ltd 2007.  All rights reserved.  Design by Branches.