OL97: Displaying Excel Custom Properties in an Outlook View

Last reviewed: January 19, 1998
Article ID: Q161740

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

  1. 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
    
    

  2. Select cell A2.

  3. On the Insert menu, point to Name, and then click Define on the menu that appears to open the Define Name dialog box.

  4. Under Names In Workbook, type Department over the word "Sales," click Add, and then click OK.

  5. Select cell F2.

  6. On the Insert menu, point to Name, and then click Define on the menu that appears to open the Define Name dialog box.

  7. Under Names In Workbook, type Total, click Add, and then click OK.

Part 2 - Set Custom Worksheet Properties

  1. On the File menu, click Properties to open the File Properties dialog box.

  2. Click the Custom tab and click to select the Link To Content check box.

  3. In the Source list, click Department, and in the Name box, type Department, and then click Add.

  4. In the Source list, click Total, and in the Name box, type Total. Click Add, and then click OK.

  5. 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

  1. In Outlook, on the View menu, click Folder List.

  2. Click Personal Folders.

  3. On the File Menu, point to New, and then click Folder to open the Create New Folder dialog box.

  4. In the Name box, type "Excel Folder" (without the quotation marks).

  5. 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.

  6. Click OK. You should now see an Excel Folder shortcut under Mail on the Outlook Bar.

  7. On the Outlook Bar, click Other and My Documents. You should see Sales.xls in the Details view.

  8. On the Outlook Bar, click Mail and scroll so that you can see the Excel Folder shortcut.

  9. Drag Sales.xls from the Details view to the Excel Folder shortcut.

  10. 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

  1. On the View menu, click Show Fields to open the Show Fields dialog box.

  2. In the "Select available fields from" list, click "User-defined fields in folder."

  3. In the Available Fields list, click Department, and then click Add.

  4. In the Available fields list, click Total, and then click Add.

  5. 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."


Additional query words: 97
Keywords : IntpOLE
Version : WINDOWS:97
Platform : WINDOWS
Issue type : kbhowto


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: January 19, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.