As you learned at the end of Chapter 6, Outlook 98 and Outlook 2000 include 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 7-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 Microsoft 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 7-1. Outlook Today is an HTML feature that was added in 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 (that is, the computer running 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, one each 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, visit http://www.microsoft.com/office/ork/.
There are some differences between the Outlook Today page in Outlook 2000 and the Outlook Today page in previous versions of Outlook. In this section, we'll look at the most significant changes made to Outlook Today in Outlook 2000.
One of the major differences in the new version of Outlook Today is the user interface. In Outlook 2000, the ability to change both the folders that are listed and the style of the Outlook Today page is integrated directly into the user interface. Figure 7-2 shows the new interface for the Outlook Today page, and Figure 7-3 shows the Customize Outlook Today page.
Figure 7-2. The new interface for Outlook Today in Outlook 2000.
Figure 7-3. The customization page for Outlook Today in Outlook 2000.
The new Outlook Today page has two security changes from previous versions. First, browsing security is disabled for the default Outlook Today page. When the user clicks on links or navigates to other pages, the browser turns on security for those pages. Therefore, you need to make sure that the controls or scripts you use in your default Outlook Today page are secure. However, you also need to make sure any links to which the user tries to navigate are not affected by the browser security being on.
Second, if the default page is a frameset, browser security is disabled when the parent frame is the page displayed in Outlook Today. This means security will not be enabled when a user makes any changes to or performs any navigation in child frames. Security will be enabled only when the user changes the parent frame to navigate to a different location. For this reason, you should force the links in the child frames of a frameset to open in the parent frame.
Since the new version of Outlook Today implements a subset of Internet Explorer technology, there are two browser issues that you should be aware of. First, the frameset or Iframe HTML elements might not work as you expect. For example, when you set the target to be a blank frame, the new window will open in Outlook rather than in a separate Web browser. Second, you might find that HTML forms or tabular data controls do not work correctly.
To remedy these problems, you will have to modify Outlook Today to use a full version of Internet Explorer. Note that when you make this change you will lose the performance enhancements of Outlook Today, such as the <RENSTATICTABLE> elements. To modify Outlook Today to use the full Internet Explorer version, add two settings to the registry in the following location:
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\9.0\Outlook\Webview\mailbox] "url"="http://YOURLOCATION/default.htm" "navigation"="yes" |
You also can make this change programmatically on a folder-by-folder basis by setting the WebViewAllowNavigation property to True on the MAPIFolder object that represents the folder. By default, folder home pages, which you'll learn about later in the chapter, use the full version of Internet Explorer to display content.
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 use Internet Explorer. Follow the steps listed below.
res://c:\Program Files\Microsoft Office\Office\1033\Outlwvw.dll/Outlook.htm
NOTE
The 1033 in the path above specifies the locale for your language. If you are using a version of Microsoft Office with a language other than English, you'll need to change the 1033 to the correct value for your language.
You need to modify your registry settings so that Outlook knows you want Outlook Today to point to a new file. You could write a program that performs this step for your customers:
HKEY_CURRENT_USER\Software\Microsoft\Office\9.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. 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 hyperlinksUsing 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 uses 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 Microsoft Visual Basic Scripting Edition (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 6.
Using the Outlook Databinding controls
The Databinding controls provided in Outlook can quickly bind and display information contained in Outlook folders. The Databinding control places the information dynamically bound from Outlook data into the sections of the Outlook Today HTML page designated by the RENSTATICTABLE elements. You can point these controls at public folders rather than at default folders such as Calendar or Tasks. We'll look at the Databinding control in detail in Chapter 11, when we discuss the Digital Dashboard.