This documentation is archived and is not being maintained.

How to: Determine the Parent Folder of Unsaved Items

Note Required applications

The code example in this topic can be compiled only if you have the required applications installed.

For more information, see Features Available by Product Combination.

  • One of these development environments:

    VSTO 2005


    Visual Studio Team System

  • Microsoft Office Outlook 2003


This code does not compile if you use the VSTO 2005 SE version of the Outlook 2003 add-in project template. For more information, see Getting Started Programming Application-Level Add-ins.

This example determines the parent MAPIFolder of an unsaved contact item.


private void ThisApplication_Startup(object sender, System.EventArgs e)
    Outlook.ContactItem contact =
         as Outlook.ContactItem;

    Outlook.MAPIFolder folder =
        contact.Parent as Outlook.MAPIFolder;


See Also