As you learned at the end of Chapter 7, Outlook 98 includes a feature that takes advantage of the HTML support in Outlook—Outlook Today. Outlook Today allows users to view information in an HTML window, as shown in Figure 8-1, rather than as separate modules. You can also customize Outlook Today's HTML code. For example, a customized Outlook Today page might include hyperlinks to Public Folder favorites, intranet sites, or Internet sites. You can even link to other applications, such as a web-based SQL Server application. You can also create multiple Outlook Today pages for the different types of users of your application. Let's take a look at how the Outlook Today page functions and how you modify the Outlook Today page for your specific application needs.
Figure 8-1 Outlook Today is an HTML feature added to Outlook 98. Users can see different types of information in a single window.
The standard Outlook Today page takes advantage of a feature in Microsoft Internet Explorer called data binding. Data binding allows Outlook to quickly display the user interface for the Outlook Today page while asynchronously downloading data from the Exchange Server to the Outlook client. Once the data is downloaded, Outlook can modify the data without making additional trips to the server. On the default Outlook Today page, there are three separate data binding tables for your Calendar, Tasks, and Mail. To modify the location of these tables or to add new functionality to the Outlook Today page, you need to know how to modify HTML. Since Outlook Today leverages Internet Explorer, you can even use Dynamic HTML (DHTML) in your customization. However, remember these limitations when customizing the Outlook Today page:
NOTE
The standard Outlook Today pages are hosted in a resource dynamic link library (DLL), which improves the performance of the Outlook Today application. When modifying your Outlook Today pages, you have the option to place your custom HTML pages and images in a resource DLL. However, this book covers only customizing Outlook Today and saving these customizations as HTML files. To learn how to compile your files into a resource DLL for Outlook Today, refer to the Outlook 98 Deployment Kit. The Deployment Kit is presently not available for retail purchase or download from the Web, but you can access the Deployment Kit documentation from http://www.microsoft.com/office/98/outlook/documents/O98DKdoc.htm.
Customizing the Outlook Today page and saving the result as an HTML file involves a few steps, which are outlined in the following sections.
To view the source of an HTML page in Internet Explorer, you can right-click on the page and select View Source from the context menu. If you right-click on the Outlook Today page to view the source of the HTML page, however, you will notice that the View Source option is not available—Outlook disables this option. To retrieve the HTML source for the Outlook Today page, you can copy the Outlook.htm file from the Outlook 98 Deployment Kit, or you can use Internet Explorer to retrieve the source by following these steps:
res://c:\Program Files\Microsoft Office\Office\ Outlwvw.dll/Outlook.htm |
You need to modify your Registry settings so that Outlook knows you want Outlook Today to point to a new file for its functionality. You could write a program that performs this step for your customers:
HKEY_CURRENT_USER\Software\Microsoft\Office\8.0\ Outlook\Today |
If the Today key does not exist, create it. Right-click on the Outlook key, point to New, and select Key. Type Today for the name of the key.
The final step is to customize the HTML file with your functionality. The easiest way to do this is by using a text editor, because the HTML code in the page contains special formatting that will make the file appear incorrectly in Microsoft FrontPage. Let's review some of the ways you can customize the Outlook Today HTML page.
Changing fonts Since Outlook Today uses cascading style sheets, you can easily change fonts and styles by modifying the style sheet. For example, you could change the font for important items by changing the .itemImportant {color:red} line in the style sheet to the desired font and color.
Adding text, images, and hyperlinks Using HTML, you can add new text, images, or hyperlinks to your Outlook Today page. Remember that if you link to an external web site, Outlook will not implement the security that you set in your standard web browser. So use the following code when placing external links in the Outlook Today page:
<a style="cursor:hand" class="itemNormal" onclick= "window.open('http://www.microsoft.com/exchange/','_blank');"> Exchange web site</a> |
Adding components Since Outlook Today leverages Internet Explorer, you can place any components on your page as long as Internet Explorer supports them. These components can include ActiveX controls as well as Java applets. However, make sure you trust the source of the component because Outlook does not check the component's security credentials.
Adding script Outlook Today supports both JScript as well as VBScript. From script, you can access the Outlook object library and use its functions in your Outlook Today page. You can see an example of a customized Outlook Today page for the Account Tracking application in Chapter 7.