This 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 an optional database. To create a new account, the user either installs the Account Tracking form in a forms library or uses the Create New Account hyperlink in the customized 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 Account Tracking application also connects to a Microsoft Access database, which enables users to retrieve revenue information. The Account Tracking application does not write to the database. By studying this application, you should learn how to:
After you review the features of the application, you'll learn how to set it up and examine the code that drives it.
The primary way the user interacts with this application is by accessing data through the Account Tracking folder, so this folder provides a number of views that enable the user to find desired information quickly. 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 7-1.
Figure 7-1 The Accounts view in the Account Tracking folder.
Two other views use filters so that the user can quickly find only contacts or only tasks without looking at the other items in the folder. The Accounts-Color view uses conditional formatting features 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 7-2 shows the contacts for different accounts in a view named Account Contacts. This view allows users to print out the contacts list so that it's portable—they can take it with them in paper-based planners.
Figure 7-2 The Account Contacts view of the Account Tracking folder, which shows only the contacts for the different accounts.
Users employ the Account Tracking form to create a new item, such as a new account, a contact, a task, a letter, or a NetMeeting. The form is accessed by double-clicking on an account or by selecting New Account Info from the Actions menu. Figure 7-3 shows the Account Tracking form. It consists of a customized Post form with multiple tabs and ActiveX controls.
Figure 7-3 The Account Tracking form.
Every action, such as creating a task or a contact, creates an item in the folder or launches an external program such as Microsoft Word. Depending on the action invoked, a specific Outlook form is displayed. This form is then 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 7-4 shows the Account Contact form, which is customized, and Figure 7-5 shows the Account Task form, which is a standard Outlook Task form.
Figure 7-4 The Account Contact form is a customized version of the Outlook Contact form.
Figure 7-5 The Account Task form uses the standard Outlook Task form.
The Account Tracking form includes an ActiveX control—the Microsoft Internet Explorer component—which 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 web site address in the Company Website text box on the Account Info tab of the form, as was shown in Figure 7-3, and then clicking the Go button. This control is automated by using Microsoft Visual Basic Scripting Edition (VBScript) coder.
Optionally, the Account Tracking form can connect to a database using Data Access Objects (DAO) version 3.5. 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 includes Outlook formula fields that total the actual revenues and the quota for each product, as shown in Figure 7-6.
Figure 7-6 The Revenue tab in the Account Tracking form. You can optionally use a database to populate the fields in this page. Outlook will automatically calculate the totals for each of the products using Formula fields.
If the user has Microsoft Excel 97 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 launches Excel and passes the numbers from the Revenue tab to the Excel chart, as shown in Figure 7-7. This functionality is accomplished by using VBScript in the form.
Figure 7-7 The Excel charts are created by clicking on the Create Sales Charts link on the Revenue tab.
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 finds all the account contacts and changes the address of each, as long as the original address is the same as the account address.