The information in this article applies to:
- Microsoft Outlook 97
- Microsoft Excel 97
SUMMARY
This article describes how you can use the Microsoft Outlook 97 Message
view of a messaging application programming interface (MAPI) folder to
display a Microsoft Excel 97 worksheet's custom properties.
MORE INFORMATION
The example below allows you to display a list of Microsoft Excel
worksheets in such a manner that contents of selected cells are also
displayed. For example, in Outlook your worksheets may be displayed as
follows, where Department and Total are cell ranges within each worksheet:
From Subject Department Total
---- ------- ---------- -----
John Doe Sales.xls Sales 100,000
Jane Doe Expenses.xls Expenses 500
The example below is a four-part process. First, you create a Microsoft
Excel worksheet that includes named cell ranges. Second, you define the
named cell ranges as custom properties of the worksheet. Third, you create
a MAPI folder in Outlook and copy the Microsoft Excel worksheet into the
MAPI folder. Fourth, you create user-defined fields in the MAPI folder that
match your Microsoft Excel worksheet custom properties.
Part 1 - Define Named Cell Ranges in a Microsoft Excel Worksheet
- In Microsoft Excel, create a new worksheet as follows and format cell A2
as text and cells B2:F2 as numbers:
A B C D E F
1 Department Q1 Q2 Q3 Q4 Total
2 Sales 25,000 25,000 25,000 25,000 100,000
- Select cell A2.
- On the Insert menu, point to Name, and then click Define on the menu
that appears to open the Define Name dialog box.
- Under Names In Workbook, type Department over the word "Sales," click
Add, and then click OK.
- Select cell F2.
- On the Insert menu, point to Name, and then click Define on the menu
that appears to open the Define Name dialog box.
- Under Names In Workbook, type Total, click Add, and then click OK.
Part 2 - Set Custom Worksheet Properties
- On the File menu, click Properties to open the File Properties dialog
box.
- Click the Custom tab and click to select the Link To Content check box.
- In the Source list, click Department, and in the Name box, type
Department, and then click Add.
- In the Source list, click Total, and in the Name box, type Total. Click
Add, and then click OK.
- Save the worksheet as Sales.xls in your My Documents folder, and then
close it.
Part 3 - Create a MAPI Folder and Copy the Worksheet
- In Outlook, on the View menu, click Folder List.
- Click Personal Folders.
- On the File Menu, point to New, and then click Folder to open the
Create New Folder dialog box.
- In the Name box, type "Excel Folder" (without the quotation marks).
- Make sure the Folder Contains list is set to Mail Items and that
the "Create a shortcut to this folder in the Outlook Bar" check
box is selected.
- Click OK. You should now see an Excel Folder shortcut under Mail on
the Outlook Bar.
- On the Outlook Bar, click Other and My Documents. You should see
Sales.xls in the Details view.
- On the Outlook Bar, click Mail and scroll so that you can see the Excel
Folder shortcut.
- Drag Sales.xls from the Details view to the Excel Folder shortcut.
- On the Outlook Bar, click the Excel Folder shortcut to open the MAPI
Excel Folder. You should see Sales.xls in the Messages view.
Part 4 - Creating User Fields in the MAPI Folder
- On the View menu, click Show Fields to open the Show Fields dialog box.
- In the "Select available fields from" list, click "User-defined fields
in folder."
- In the Available Fields list, click Department, and then click Add.
- In the Available fields list, click Total, and then click Add.
- Click OK.
In your Excel Folder's Message view you should see Sales.xls with the
contents of the Department and Total custom properties displayed.
REFERENCES
For more information about creating name ranges in Microsoft Excel, type
"name range" in the Office Assistant, click Search, and then click to view
"Name cells in a workbook."
For more information about creating Outlook user-defined fields, type
"creating user-defined fields" in the Office Assistant, click Search, and
then click to view "Create a custom field."
|