[转载] 修改outlook今日

Outlook Today

Microsoft Outlook 98 includes a unique "at a glance" view called Outlook Today. This view displays information about the user's calendar, tasks, e-mail, and contacts, using the familiar and attractive style. of a Web page. Outlook Today lists upcoming appointments, indicates what tasks are due, lets users search Outlook for contacts, and shows the number of unread e-mail messages in the user's Inbox. Each item on the Outlook Today page is a hyperlink to an Outlook item or view, so users can gain access to more specific information about a meeting or check off a completed task. And end user can easily customize his or her Outlook Today page by using the Outlook Today Options page. For example, the Options page lets end users change how many days of meetings to display.

Outlook Today displays information in HTML, which allows limited customization by enterprise developers and solution providers. Outlook Today can be thought of as a "home page" of information available to Outlook users; therefore, it provides an excellent opportunity to deliver corporate intranet or public Internet content, in addition toOutlook information. For example, you might create a standard Outlook Today page that shows a bulletin of corporate news and a stock ticker tied to real-time market data taken from the Web. A customized version of Outlook Today might also contain information drawn from other enterprise applications (such as account tracking or financial management software), enabling an Outlook Today page that is targeted to a specific job function within an organization. For example, you might create an Outlook Today page for sales and marketing employees, the accounting department, or senior management.

Outlook Today uses databinding, a new feature of Microsoft Internet Explorer 4.0, to link an HTML table on the page to a datasource—Outlook 98, in this case—via an ActiveX® datasource control. The page has separate databinding tables for the Calendar, Mail, and Tasks sections. After the page loads, the datasource controls collect the appropriateOutlook information and display it in the databinding tables. Whenever the source information is updated or new items are created, the databinding controls update their tables dynamically without refreshing the page. (For more information about databinding, see the Internet Client SDK). You can customize the Outlook Today page in the following ways:

Adding text, links, and images 
Adding script 
Adding ActiveX components 
Changing styles (backgrounds, fonts, etc 

Customizing Outlook Today is an advanced developer feature. Therefore, keep in mind the following limitations when you add content and functionality to the Outlook Today page:

Although Outlook Today provides users with a powerful time-saving summary view, it is not intended to replace the Inbox, Calendar, or Task modules. Nor is Outlook Today intended to replace a Web browser. You should consider Outlook Today as a summary and starting point for personal, intranet, and Internet information delivery. 
Modifying the Outlook Today page may result in reduced performance when information is retrieved and rendered on the page. Again, you should consider the Outlook Today page as a starting point, which users read at startup or check into periodically during the day or week.
Outlook Today is expected to change in future releases of the product. Therefore, any changes to Outlook Today pages that work in Outlook 98 may require additional updates or rewriting in future versions of Outlook. 
You can modify Outlook Today by adding links or controls that connect to untrusted, external Web sites or content providers. Outlook Today does not verify the security of the URL you assign to Outlook Today in the registry or the pages you browse within the Outlook Today frame. Outlook Today pages that contain unsafe content can expose individual users and entire organizations to the risks associated with that content, including viruses and data destruction. 

Note If you must include links to untrusted, external sites on your customized page, make sure that the links launch the URLs in a new browser window to take advantage of browser security. For instructions, see "Customization Details" in this chapter. 

You cannot add Outlook Today as an Active Desktop® item. The Outlook Today functionality only works when it is hosted within the Outlook window. 

Distributing Your Customized Outlook Today Page

There are three ways to distribute a customized Outlook Today page:

Customized .dll file. You can save your customized Outlook Today page as a .dll file and view it in place of the default Outlook Today page; for more information, see "Advanced Customization" in this chapter. This method uses the res:// protocol. For example, the protocol for the default page is res://Outlwvw.dll/Outlook.htm. For an arbitrary path, use the following format: 

"Url" = "res://C:\Program Files\Microsoft Office\Office\Outlwvw.dll/Outlook.htm" 

-or-

"Url" = "res:///" 

Web server. Because Outlook Today hosts the Internet Explorer 4.01 browser, you can save your customized Outlook Today page as an .htm or .asp file on a personal or corporate Web server; for more information, see "Basic Customization" in this chapter. This method uses the http:// protocol (for example, "Url" = "http://corpweb/users/outlook.htm"). 
File/Network. You can save your customized Outlook Today page as an .htm file on your local hard disk or corporate network; for more information, see "Basic Customization" in this chapter. This method uses the file:// protocol (for example, "Url" = "file://C:\myfile.htm").

Because advanced customization takes advantage of performance enhancements, Microsoft recommends that you save your customized page as a .dll file. It will load much faster than if you use the "Web Server" or "File/Network" scenarios. You can distribute your customized .dll file and also change the Outlook Today registry key to point to your customized page by using the Outlook 98 Deployment wizard. For more information about adding your customized .dll file to the installation package, see "Stage 2: Specify Custom Active Setup Components" in Chapter 2; for more information about adding registry keys during the installation process, see "Stage 5: Add Registry Entries" in Chapter 2.

Basic Customization

With Basic customization, you can customize and save your Outlook Today page as an .htm file on your hard disk, network, or Web server using a simple, three-part process. You will need a working knowledge of HTML and the Windows registry; the tools and ability to edit a custom .dll file are not required.

If you are proficient with Microsoft Developer Studio or a similar resource editor, Microsoft recommends that you go to "Advanced Customization" in this chapter. With advanced customization, you can save your customized Outlook Today page as a .dll file for better performance.

PART 1: To obtain the Outlook Today source

Important If you copy the Outlook.htm source file directly from the Outlook 98 Deployment Kit CD, you can skip these steps and go to Part 2.

1.In Internet Explorer, go to the following URL: 

res://C:\Program Files\Microsoft Office\Office\Outlwvw.dll/Outlook.htm 

Note the forward slash after the .dll file name. If you installed Outlook to a non-default directory, you may need to change the file path to the URL.

2.Outlook.htm will generate a script. error because it is not being hosted within the Outlook window. When you receive an error message, click No. The Outlook Today HTML page displays (without the graphics and data tables).
3.On the View menu, click Source to open a copy of the Outlook.htm source file in Notepad. 
4.On the File menu, click Save As, and save this file to your hard disk. 

Note Because Outlook Today uses specialized layout properties, it will not appear correctly in Microsoft FrontPage®98 or other HTML editors.

5.The text display:none appears three times in the file. Search for and replace all three instances with the text display:. This change is necessary because the source file was designed to be saved as a .dll file and loaded with the res:// protocol. Instead, you are saving it as an .htm file, and loading it with the http:// or file:// protocol. 
PART 2: To add the correct settings to your registry
1.Locate the following registry key:

HKCU\Software\Microsoft\Office\8.0\Outlook\Today 

2.If this key does not exist, add it. 
3.In this key, add the string value Url (this value is case sensitive). For its value data, enter the path to the Outlook.htm file that you saved in Part 1, step 4. For example, Url might contain the following data: 

file://C:\My Documents\Outlook.htm 

Note If at any time you want to reset the registry and return to your original Outlook Today page, just delete the Url registry key. Then, Outlook will point to the original Outlook Today page.

PART 3: To modify your new Outlook Today page
1.Start Outlook, and go to Outlook Today. 

The three data tables (Calendar, Mail, and Tasks) will render more slowly, line-by-line rather than all at once. This is because the page you are viewing has been loaded with the http:// or file:// protocol.

2.Modify the HTML. 

For more information about the types of changes you can make, such as adding a link or graphic, see "Customization Details" in this chapter.

Note On the Outlook Today page, you cannot customize the existing data, sorting, or filtering in any of the Calendar, Mail, and Tasks data tables (although you can remove the Mail table and add your own).

Advanced Customization

With a resource editor, such as Microsoft Developer Studio, you can save your customized Outlook Today page as a resource .dll file by using a five-part process. Advanced customization allows you to take advantage of performance enhancements, described in "Performance Impact" in this chapter.

Important The following instructions are for Microsoft Developer Studio 5.0 only. You must use Microsoft Developer Studio 5.0 (earlier versions may also work) or a similarly capable resource editor. Also, you must use Windows NT. Developer Studio does not support the ability to replace resources in executable files on Windows 95.

PART 1: To copy the original Outlwvw.dll resource file
1.Locate the Outlwvw.dll resource file, which is installed in the C:\Program Files\Microsoft Office\Office folder by default. 
2.Make a working copy of Outlwvw.dll (for example, Outlwvw_custom.dll). 

Warning Do not modify or remove Outlwvw.dll. This file contains both the Outlook Today source files and the source files for the Find and Organize features. If you want to create a custom .dll file, give the new file a different name, and update the URL setting in the registry accordingly.

PART 2: To add the correct settings to your registry
1.Locate the following registry key:

HKCU\Software\Microsoft\Office\8.0\Outlook\Today 

If this key does not exist, add it. 

2.In this key, add the string value Url. For its value data, enter the path to the Outlook.htm resource within your Outlwvw_custom.dll file that you saved in Part 1, step 2. Make sure that you use the res:// protocol. For example, Url might contain the data: 

res://C:\My Documents\Outlwvw_custom.dll/Outlook.htm 

Note the forward slash after the .dll file name. 

Note If at any time you want to reset the registry and return to your original Outlook Today page, just delete the Url registry key. Then Outlook will point to the original Outlook Today page.

PART 3: To open the resource .dll file
1.In Windows NT, start Microsoft Developer Studio. 
2.On the File menu, click Open
3.Select the Outlwvw_custom.dll that you saved in Part 1, step 2. 
4.In the Open as box, click Resources
5.Click Open to open Outlwvw_custom.dll. 
6.Double-click the tree-node 2110 to open it. 
7.Double-click the Outlook.htm node. 

You should now be in Developer Studio's binary editor, with text on the right side of the window and hex-numbers on the left side.

PART 4: To modify the HTML

You can modify the HTML file by editing the text directly in the Developer Studio binary editor, but this is a fairly difficult editor to work in. It is much easier to modify the HTML in a separate text editor, copy it, and then paste it into the Developer Studio editor.

1.In Developer Studio, select all of the .dll file text, and copy it. 
2.Open a text editor, such as Notepad, and paste in the text. 
3.Modify the HTML. 

For more information about the types of changes you can make, such as adding a link or graphic, see "Customization Details" in this chapter. 

4.When you are done, select all of the file text, copy it, and paste it back into the .dll file in Developer Studio. 
5.Save your Outlwvw_custom.dll file. 
6.View the Outlook Today page in Outlook. You will see your modified page. 

Important In the HTML, you may notice three commented sections. If you change the layout of the Calendar, Mail, or Tasks databinding tables, you will also need to make parallel changes to their associated RENSTATICTABLEs. For more information, see "About the RENSTATICTABLE" in this chapter.

If you are making and testing a large number of changes, you may prefer to use this alternate method to modify the HTML:

1.In Developer Studio, select all of the .dll file text, and copy it. 
2.Open a text editor, such as Notepad, and paste in the text. 
3.Save this file to your hard disk. 
4.Point the Outlook Today registry setting to this saved file by using the file:// protocol. 
5.Search for and replace the three instances of display:none with display:. (Because you are using the file:// protocol, the live databinding tables will not be visible without this step.)
6.Make changes to this file.

For more information about the types of changes you can make, such as adding a link or graphic, see "Customization Details" in this chapter. 

7.Undo the search and replace changes you made in step 5 to prepare the file for res:// protocol format. 
8.When you are done, select all of the text, copy it, and paste it back into the .dll file in Developer Studio. 
9.Save your Outlwvw_custom.dll file. 
10.Set the registry setting appropriately (res:///Outlook.htm). 

Go to Outlook Today to see your modified page.

Note On the Outlook Today page, you cannot customize the existing data, sorting, or filtering in any of the Calendar, Mail, and Tasks data tables (although you can remove the Mail table and add your own).

PART 5: To add images to your .dll file

If your new HTML file makes references to images outside the original Outlwvw.dll resource, you can include these images in the Outlwvw_custom.dll resource file to take advantage of the resource file's performance advantages. You can include a .gif, .jpeg, or other type of image file. (This is optional—you can always save the images as regular files on your hard disk.)

1.Using an image editor, create the .gif file that you want. 
2.With Outlwvw_custom.dll open in Developer Studio, double-click the tree node 2110
3.Select any existing .gif resource. 
4.On the Edit menu, click Copy, and then click Paste to create a duplicate of this .gif resource under the 2110 tree node. (For example: if you copy Calhdr.gif and then paste it, you will have a duplicate called Calhdr.gif1.) 
5.Right-click this duplicate resource, click Properties, and then change the name to whatever you like (for example, "Whatever.gif"). 

Remember that you must include the quotation marks around the name. 

6.In Developer Studio, open your .gif file from step 1. 
7.On the File menu, click Open
8.In the Open as box, click Binary
9.On the Edit menu, click Select All to select all of the file text. 
10.On the File menu, click Copy
11.Close this file. 
12.Double-click the new Whatever.gif resource to open it, and replace the data in the file with the data you copied in step 10.
13.Close the Whatever.gif window, and save your Outlwvw_custom.dll file. 

Your .gif file is now embedded as a resource in Outlwvw_custom.dll. You can refer to it in your Outlook.htm file as res://Outlwvw_custom.dll/Whatever.gif to take advantage of the resource file's performance optimizations.

Customization Details

This section describes the different ways that you can modify your Outlook Today page.

Adding Text and Images

The Outlook Today page is an HTML page that uses cascading style. sheets (CSS). It is laid out with standard HTML tags and CSS properties. You can add text and images just as you would on any other HTML page. For more information about how to use CSS properties, see the Internet Client SDK.

Note The original page uses the res:// protocol to point to its images (for example: res://Outlwvw.dll/Calhdr.gif). If you supply your own image files, you can use the file:// or http:// protocols (for example: file://C:\My Documents\myimage.gif).

Adding Links

To link to an external Web site, you must not use a simple HTML hyperlink. Instead, you must use the following syntax to launch that link in a new browser window, which allows you to take advantage of browser security.

Warning You must take special care when adding links to external, untrusted Web sites. If you add a simple hyperlink to your page, by defaultOutlook will follow that link within the Outlook Today window. Because security is always disabled in Outlook Today, there are no security safeguards to protect you from viewing a site that contains unsafe content.

To link to a local Outlook folder, use the following syntax:

 
 

To link to an Exchange Server Public folder, use the following syntax:

 
 
Changing Font Styles

You can change the styles of most fonts on the page by modifying their style. sheet definitions at the top of the page. For example, the following lines define the text styles for a completed task, an important item, and the date at the top of the page:

 
 

In some cases these styles are referenced directly in later lines of the page. But in other cases, such as "TskDone" and "itemImportant" above, the lines that reference these styles are dynamically generated within the three main databinding tables (Calendar, Mail, and Tasks), and you will never see them used literally in the code.

For example, when you check a task as complete in the Tasks table, the databinding table automatically applies the "TskDone" style. to the text. Because the "TskDone" style. is defined as gray strike-through, the completed task's text will also use this same style. However, you can change the style. to whatever you like.

Adding Additional ActiveX Controls

You can add ActiveX controls to the page, just as you would any other HTML page. However, the security safeguards have been disabled in Outlook Today, so you must be sure about a control's trustworthiness before adding it to your page. It's a fun exercise, for example, to add the Microsoft Investor stock ticker ( http://investor.msn.com ) to your page.

For more information about how to create your own ActiveX controls, including databinding controls, see the Internet Client SDK.

Adding Script

With script, you can also take full advantage of the Outlook object model. Be aware, however, that as with any interpreted scripting language, performance will not be at its best. This sample JavaScript. exposesOutlook's Application object, and then uses it to open the Inbox in a new Outlook window:

 
 

Disabling Outlook Today

You can turn off Outlook Today and instead show the contents of your root folder (similar to Outlook 97).

To turn off Outlook Today
1.In regedit, go to the following registry key: 

HKEY_CURRENT_USER \Software \Microsoft \Office \8.0\Outlook\Today\ 

2.Add the new DWORD Value, Disable
3.Modify the Disable Value, and give it a value data of 1

You can enable Outlook Today again by either deleting the Disable registry value or setting it to 0.

Performance Impact

With advanced customization, there is no performance degradation between your customized page and the original, even if you add a link or graphic to the page. With Basic customization, the only performance difference is that yourOutlook data (Calendar, Mail, Tasks) will appear more slowly, line-by-line, as the page loads. By comparison, in the original page, your data appears almost immediately. After it is loaded in the view, though, there is no performance difference between your customized page and the original page.

As with any Web page, the more elements that you add, such as images, script, or ActiveX controls, the longer the page will take to load. Also, performance depends on your mail support and on the number of items in your store. Using a Corporate/Workgroup configuration will decrease performance (constructing the page requires many calls to the server). The more items in your store, the longer it takes to display. For example, on a Pentium 120 with 32 MB of RAM, using an Internet Only configuration and a moderate store size, the performance difference is approximately four seconds.

To improve the performance of HTML rendering and databinding, Microsoft made the following enhancements:

Files are compiled into a resource .dll file. The Outlook Today source HTML and .gif files are compiled into a resource file—Outlwvw.dll—allowing Outlook to load the page faster. This file is installed in the ...\Program Files\Microsoft Office\Office directory. 
res:// streaming and processing. When you specify a URL with the res:// protocol, Outlook performs special streaming and preprocessing on the page. This does not take place when you use the http:// or file:// protocols. 

When the page first loads, it takes some time for the databinding tables to collect and render all of their data. To avoid this delay and display your information more quickly at load-time,Outlook initially hides the three databinding tables and replaces them with temporary, raw HTML tables. As it streams the HTML from the resource .dll file,Outlook builds temporary static tables (containing the same information as the live databinding tables) and inserts them directly into the stream (at the RENSTATICTABLE tags). As a result, yourOutlook information appears faster than if you had to wait for the databinding to complete. 

After the page is loaded, the hidden databinding tables activate and gather their data. When they finish, Outlook hides the temporary static tables and makes the live databinding tables visible. This switch from static to live tables is not noticeable in the Calendar and Mail tables, but you will see it in the Tasks table (when the column of check boxes appears).

Note These performance enhancements apply only to pages loaded via the res:// protocol, not via http:// or file:// protocols.

About the RENSTATICTABLE

In the HTML, you'll see three commented RENSTATICTABLE blocks. When Outlook reads the page through the res:// protocol, it uses these blocks to determine how to insert the temporary static tables.

For example, review the block that defines the Calendar (both live and static tables):

 
 
DATAFORMATAS="html">
DATAFORMATAS="html">
datafld="SubjectLocation" DATAFORMATAS="html">

 

 
 

The block includes two sections, the Live Databinding Table and the Temporary Static Table. Relevant elements include the following:

display:none 

This is a CSS attribute that tells the page to hide the table. When the page loads, this table stays hidden and the temporary static table is visible instead. After the live databinding table gathers all of its information, however,Outlook overrides the display:none attribute automatically and removes the static table. In most cases, this switch is imperceptible. 

 

This element tells Outlook to "insert a temporary static table here." The properties that follow this tag describe how to construct the table, giving you a necessary degree of control over howOutlook constructs its temporary static tables. In most cases, you may want to make the static table look like the live table so that the switch is imperceptible. 

Notice that each section of the RENSTATICTABLE syntax corresponds to a section in the live table definition. 

~Calendar 

This element identifies the static table that contains the data for the Calendar. 

~Next=valign=top width=10 

This element tells Outlook to add a first column (

) to the table for each row, with the following syntax: 

...
{inserts "Next" data here for each row}
...

This column contains the triangular "Next/Current Appointment" indicator. 

~StartEnd=valign=top nowrap 

This element tells Outlook to add another column to each row: 


...
{inserts "StartEnd" data here for each row}
...

This column contains the start and end times for each appointment. 

~SubjectLocation=valign=top 

This element tells Outlook to add a final column to each row: 


...
{inserts "SubjectLocation" data here for each row}
...

This column contains the Subject and Location for each appointment. 

~ 

The final "~" is required. It signals the end of the command. 

CalendarSubjectLocation style, InboxCount styles, etc. 

When Outlook constructs the cells, it adds a class property to the cell tag that is a combination of the table name and the column name: 

+  

This allows you to set the styles of the table cells for each column. Then you can define these styles at the top of the Outlook.htm file, among the CSS style. definitions. You will notice that two definitions already exist: 

 
 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22021749/viewspace-615198/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/22021749/viewspace-615198/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值