Chapter 8: The Account Tracking Application


This chapter describes the Account Tracking application, an application for tracking contacts, team members , tasks , and revenue for different company accounts. It was developed using many of the techniques explained in previous chapters. The application is included with the book's sample files.

Overview of the Account Tracking Application

The Account Tracking application uses a customized Post form, a customized Contact form, the standard Task form, a customized Outlook Today page, a customized folder, and a database. (The use of the database is optional.) To create a new account, a user either installs the Account Tracking form in a forms library or uses the Create New Account hyperlink in the application's Outlook Today page. After the account is created, the user can create new contacts or new tasks for the account. The user can even track internal team members who service the account. The application also connects to a Microsoft Access database, which enables users to retrieve revenue information, but the application does not write back to the database. By studying this application, you can learn how to

  • Customize a Post form and a Contact form in Microsoft Outlook.

  • Use ActiveX controls on an Outlook form.

  • Programmatically restrict items by using the Outlook object library.

  • Automate other programs from an Outlook form.

  • Connect a database to an Outlook form, and use a database as a data source for Outlook fields.

  • Customize the Outlook Today page.

  • Learn how to write COM Add-ins for Outlook.

  • Learn how to use the Outlook View control and Outlook folder home pages.

  • Call XML Web services from your Outlook applications.

After we review the features of the application, you'll learn how to set it up and examine the code that drives it.

The Account Tracking Folder

The primary way a user interacts with this application is to access data through the Account Tracking folder. This folder provides a number of views that enable users to quickly find the information they need. Although users can create their own data views for the folder, the application does provide some unique views by default. One view, called the Accounts view, lets a user see all accounts and related contacts and tasks in a threaded view. All associated tasks and contacts are threaded from the original form for the account, as shown in Figure 8-1.

click to expand
Figure 8-1: The Accounts view in the Account Tracking folder

Two other views use filters so the user can find only contacts or only tasks without looking at the other items in the folder. The Accounts-Color view uses conditional formatting to color -code accounts, contacts, and tasks.

Recall that Outlook supports multiple types of views, such as timeline and card views, in a single folder. Our Account Tracking folder offers these special types of views. Figure 8-2 shows the contacts for different accounts in a view named Account Contacts. This view allows users to print the contacts list so that it's portable ”they can take it with them in paper-based planners.

click to expand
Figure 8-2: The Account Contacts view of the Account Tracking folder, which shows only the contacts for the different accounts.

The Account Tracking Form

Users employ the Account Tracking form to create a new account, contact, task, letter, NetMeeting, or some other new item. The form is accessed by double-clicking on an account or by choosing New Account Info from the Actions menu. Figure 8-3 shows the Account Tracking form. It consists of a customized Post form with multiple tabs and ActiveX controls.

click to expand
Figure 8-3: The Account Tracking form

Actions such as creating a task or a contact creates an item in the folder or launches a program such as Microsoft Word. Depending on the action invoked, a specific Outlook form might be displayed. This form is automatically posted into the folder as a reply to the original Account Tracking form, which allows the application to use the conversation topic and conversation index fields to create threaded views of the accounts, including their associated contacts and tasks. Figure 8-4 shows the Account Contact form, which is customized, and Figure 8-5 shows the Account Task form, which is a standard Outlook Task form.

click to expand
Figure 8-4: The Account Contact form, a customized version of the Outlook Contact form.
click to expand
Figure 8-5: The Account Task form using the standard Outlook Task form.

The Account Tracking form includes an ActiveX control ”the Microsoft Internet Explorer component ”that is embedded on the Company Website tab of the form. Using this control, the user can browse an account's Web site by entering the site's address in the Company Website text box on the form's Account Info tab, as shown earlier in Figure 8-3, and then clicking the Go button. This control is automated by using the Microsoft Visual Basic Scripting Edition (VBScript) coder .

Optionally, the Account Tracking form can connect to a database using ActiveX Data Objects (ADO). The database can be used to retrieve financial information for the Revenue tab of the form. If information is pulled from the database, the Revenue tab will include Outlook formula fields that total the actual revenues and the quota for each product, as shown in Figure 8-6. If you want to use ADO.NET, you must encapsulate your code in a .NET control and provide that control to your Outlook form via COM interop. Outlook's VBScript does not natively support ADO.NET.

click to expand
Figure 8-6: The Revenue tab of the Account Tracking form, whose fields you can use a database to populate

If the user has Microsoft Excel 2000 or later installed, the Account Tracking application can create reports and charts in Excel. If the user clicks on the Create Sales Charts link on the Revenue tab, Outlook will launch Excel and pass the numbers from the Revenue tab to the Excel chart, as shown in Figure 8-7. You implement this functionality by using VBScript in the form.

click to expand
Figure 8-7: The user can click on the Create Sales Charts link on the Revenue tab to create Excel charts.

The final feature of the Account Tracking form is the use of Outlook events, such as Item_Open and Item_Close , to set up the environment for the user and ensure that objects needed by the application are available. For example, when a user changes the address of an account using the Account Tracking form, the Item_Close event detects this and asks whether the user wants to update all the addresses for all contacts of that account. If the user answers yes, the application will find the account contacts and change the address of each, as long as the original address is the same as the account address.




Programming Microsoft Outlook and Microsoft Exchange 2003
Programming MicrosoftВ® OutlookВ® and Microsoft Exchange 2003, Third Edition (Pro-Developer)
ISBN: 0735614644
EAN: 2147483647
Year: 2003
Pages: 227
Authors: Thomas Rizzo

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net