Extending Outlook Today

Outlook Today can give you a brief overview of what's coming up on your daily schedule. However, many people want more information than the standard Outlook Today pages offer. If you want Outlook Today to show you other information in different ways, you can further customize Outlook Today by directly editing the HTML behind the Outlook Today page. You can also create your own new Folder Home Page that you can use in any of your Outlook folders as a substitute for Outlook Today.

Some of the improvements HTML coding can bring to Outlook Today are

  • Adding your corporate logo or other company information to the Outlook Today page

  • Adding hyperlinks to resources on the corporate intranet or the Internet

  • Adding ActiveX controls to display data from a variety of external sources

  • Adding scripts to perform various Outlook-related tasks

  • Customizing fonts, colors, and styles

The previous list contains just a few of the customization options available in Outlook Today. You can create a custom Outlook Today page and roll that page out to all of your users so that everyone has a version of Outlook Today branded for your corporation, as shown in Figure 8.6.

Figure 8.6. You can create a customized Outlook Today page with your corporate logo and links.

graphics/08fig06.gif

Using HTML Code to Create a New Outlook Today Page

If you examine the folder properties for the Outlook Today folder, you'll notice that the folder home page for Outlook Today looks something like this:

 res://C:\Program Files\Microsoft Office\OFFICE11\1033\outlwvw.dll/outlook.htm 

Your actual file location might be slightly different based on where you installed Office 2003 and which style of Outlook Today page you chose. For example, the Winter style ends with outlook4.htm.

Because Outlook Today is really just an HTML page, you can use normal HTML coding to manipulate the page. Before you make any major changes to the Outlook Today files, create a backup of the entire file or at least the HTML source for the file. That way, if you make a mistake or you just decide you want to recover the original file, you have a proper backup.

But first you'll need to open the file in an HTML editor. You can't just search your hard drive for the file outlook.htm. The file is actually embedded within a DLL. To access the code behind the file, use the following steps:

  1. Open Internet Explorer.

  2. Stop the current page form loading by clicking the Stop button.

  3. Enter the Outlook Today location you found by examining the properties of Outlook Today. Click Go or press Enter on the keyboard to display Figure 8.7.

    Figure 8.7. You can open an Outlook Today background in your browser.

    graphics/08fig07.gif

  4. Select View, Source to display the source of the Outlook Today file in Notepad.

  5. Click File, Save As to save the text as a backup file on your hard drive. You can save the file a second time to create a file to serve as the starting point of your Outlook Today customization. Save the file a second time as Outlook.htm.

  6. You're now ready to start making changes to the source code in the Outlook.htm file.

NOTE

You can choose what HTML editor to use to customize Outlook Today. My two personal favorites are Visual InterDev and Microsoft Front Page. After you save the source code file to your hard drive, you can open the file with either of those programs and edit the file. However, you can also use Notepad to edit your HTML file. The advantage to Notepad is that it won't bloat your HTML file as FrontPage does, and it's significantly easier to use than Visual InterDev. The disadvantage is that it won't check for syntax errors while you're coding.


CAUTION

If you customize Outlook Today by adding your own HTML code, you lose the ability to click the Customize Outlook Today button and change the information displayed on the page. If you plan to deploy customized Outlook Today pages to users in your organization, remove the Customize Outlook Today hyperlink from your customized page.


Now that you have the source code for Outlook Today, you can start to customize it. Open the Outlook.htm file you created in any HTML editor or in Notepad. You need to do a few things right from the start before you can continue to customize the file.

Outlook Today is designed to run as a DLL. To run the file as an .htm file instead of a .dll, you must replace a small bit of text in three places within the file. In the HTML code for the file, find the text display:none and replace it with display:. After you have completed these three changes, save the file and you can continue to modify it.

Adding or Removing Graphics

You can use HTML to add or remove graphics from Outlook Today. For example, the black and yellow bar at the top of the standard Outlook Today page might not match your corporate logo colors. You can replace that image with a custom image. To accomplish this, replace the image of the clock with your own custom image, perhaps your corporate logo.

The exact text varies based on the Outlook Today style you've chosen. However, in the standard Outlook Today page, look for the following line in the source code:

 <img id=outlook_align2 src=clock.gif border=0 align=left valign=top hspace=0 vspace=0 height=30px> 

Replace the image name clock.gif with your own image. In Figure 8.8, I've replaced the clock with my company logo.

Figure 8.8. You can create a customized Outlook Today page with your company logo.

graphics/08fig08.gif

Other changes you can make to Outlook Today include

  • Adding an instance of the Outlook View Control to show the items in an existing Outlook Folder

  • Adding buttons to email a daily report

  • Adding a hyperlink to the corporate intranet to check out company news

  • Adding links to commonly used documents located on a corporate server

Each of these items is explained briefly in the following sections.

Adding the Outlook View Control to Outlook Today

A common complaint about Outlook Today is that, although it can show you the unread item count for a variety of different folders, it can't show you the actual items in those folders. If you want a folder's contents to be displayed on the Outlook Today page, you can add an instance of the Outlook View Control to your custom Outlook Today page and configure the View Control to display any folder you choose.

To set a reference to this file in an HTML page, use the following code:

 <html> <head> </head> <body> <OBJECT classid=CLSID:0006F063-0000-0000-C000-000000000046         id=ViewCtlFolder         width="100%"         height="430">    <param name="Namespace" value="MAPI">    <param name="Folder" value="Tasks">    <param name="View" value="By Category">    <param name="Restriction" value="">    <param name="DeferUpdate" value="0"> </OBJECT> </body> </html> 

The preceding example creates a folder home page that displays a By Category view of your tasks, as shown in Figure 8.9.

Figure 8.9. An Outlook View Control viewing the Tasks folder.

graphics/08fig09.gif

Adding Action Buttons to an Outlook Today Page

Another modification you might want to make to your Outlook Today page is to add some buttons to accomplish the things you do most often in Outlook. For example, if you create an email message to your boss every morning when you get into the office, you can create a button to launch an email and populate the email address automatically.

Use the following code to launch a new email:

 Sub CreateEmail() set oMessage = oFolder.Items.Add("IPM.Note") oMessage.To = "david@techhelpers.com" oMessage.Display() End Sub 

When creating script inside an HTML page, it's best to group all the script together. I usually put all of my script at the end of my HTML code. To create a button to respond to the preceding action and keep your Outlook Today code clean and well delineated, I use code similar to the following to control my action buttons and hyperlinks:

 Sub document_onclick()     'Set a variable to the id of the clicked component     MyElem = window.event.srcElement.id     'Set a variable to the type of control (the className)     MyClass = window.event.srcElement.className     'If the className is not empty, decide which action to perform     If MyClass <> "" then         'If the className is actionlinks then call         'the code associated with that className        If MyClass = "actionlinks" then         'In this example, MyElem = CreateEmail          Call Actions_onClick(MyElem)         end if     end if End Sub 

Then, use code similar to the following to create your hyperlinks. This code should be within the HTML code of Outlook Today, rather than in the scripting section. Creating the buttons within a table helps keep all of them evenly spaced and easy to manipulate.

 'Create your table within your HTML code <table width="90%" border=0 id > 'Create a new table row <tr> 'Create new clickable links   <td >     <span style="width:92px"  >Create Email</span>     <span style="width:92px"  >Check Stocks</span> </td> </tr> </table> 

If you launch Internet Explorer every morning to check your stocks, you can create a button to launch your Web browser and navigate to your favorite financial page.

Use the following code in the scripting section of your custom Outlook Today page to open a Web browser and navigate to your favorite financial Web site:

 Sub CheckStocks() 'Open Internet Explorer Set iExplorer = CreateObject("IE.Application") 'Display Internet Explorer iExplorer.Visible = True 'Navigate to a website iExplorer.Navigate www.cnn.com End Sub 

The last bit of code you'll need is the subroutine that actually calls the actions your buttons represent. It should look something like this:

 Sub Actions_onClick(Action) 'This code calls a sub based on the 'className of the clicked link     Select Case Action         case "CreateEmail"             CreateEmail()         case "CheckStocks"             CheckStocks()     end select End Sub 

After all the additions you add to your code, the VBScript to respond to the button clicks should look something like this:

 <SCRIPT ID=clientEventHandlersVBS LANGUAGE="vbscript"> Set oApplication = window.external.OutlookApplication Set oNS = oApplication.GetNamespace("MAPI") Set oFolder = oNS.GetDefaultFolder(6) Sub document_onclick()     MyElem = window.event.srcElement.id     MyClass = window.event.srcElement.className     If MyClass <> "" then         If MyClass = "actionlinks" then             Call Actions_onClick(MyElem)         end if     end if End Sub Sub CreateEmail()     Set oMessage = oFolder.Items.Add("IPM.Note")     oMessage.Recipients.Add "david@email.com"     oMessage.Display() End Sub Sub Actions_onClick(Action)     Select Case Action         case "CreateEmail"             CreateEmail         case "CheckStocks"             CheckStocks     end select End Sub </script> 

Your finalized Outlook Today page should look something like Figure 8.10.

Figure 8.10. Your customized Outlook Today page can incorporate a variety of new elements.

graphics/08fig10.gif

Modifying the Registry to Set Your New Outlook Today as Default

Now that you've customized your Outlook.htm file, you need to modify your Windows Registry to be able to use the file you created rather than the Outlwvw.dll file. Before you make any changes to the Registry, make sure that you have a current backup of the Registry.

For more information about editing the Registry, see "Working with the Windows Registry," p. 935.


To modify the Registry to accept your new Outlook Today page, use the following steps:

  1. In Windows, click Start and then Run to display the Run dialog box shown in Figure 8.11.

    Figure 8.11. This dialog box is used to launch the Registry Editor.

    graphics/08fig11.gif

  2. Type regedit in the Open box and click OK or press Enter on the keyboard to launch the Registry Editor shown in Figure 8.12.

    Figure 8.12. The Registry Editor opens to the last key you were viewing.

    graphics/08fig12.gif

  3. Navigate to the following key: HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Today. Select the key to display Figure 8.13.

    Figure 8.13. The Outlook Today Registry key has multiple values.

    graphics/08fig13.jpg

  4. Click the CustomURL value.

  5. Select Edit, Modify to display the Edit String dialog box shown in Figure 8.14.

    Figure 8.14. Use this dialog box to edit the location of Outlook Today.

    graphics/08fig14.gif

  6. Replace the current data with the complete path and name of your new Outlook Today file. You must include the string File:// before the full path name to tell Windows you're no longer using the res protocol, but are using the File protocol. So, if your file were located in C:\OutToday, your entire value would be File://C:\OutToday\Outlook.htm.

  7. Select File, Exit to close the Registry Editor. You should now be able to see your newly customized Outlook Today page.

The next time you start Outlook and navigate to Outlook Today, you might notice that the page loads slightly slower than usual. This is because you are actually loading an HTML page, instead of a DLL. Depending on the types of code you have in your HTML page, you might notice more or less of a slowdown. If Outlook Today loads extremely slowly, consider removing high bandwidth graphics or external content.

graphics/troubleshoot_icon.jpg

If you're having problems customizing your newly implemented Outlook Today page, see "Customizing a Custom Outlook Today Page" in the "Troubleshooting" section at the end of this chapter.




Special Edition Using Microsoft Office Outlook 2003
Special Edition Using Microsoft Office Outlook 2003
ISBN: 0789729563
EAN: 2147483647
Year: 2003
Pages: 426

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