locked
different pst file with same folder name RRS feed

  • Question

  • I observed that we can have top level folders with same name in outlook. We can take a new outlook data file and provide the a name that is already existing in top level.

    Outlook.MAPIFolder yyyyFolder = this.Application.GetNamespace("MAPI").Folders["YYYY"];

    I have three folders with same name, but pst is different.

    How to get the folder that I need from these three folders?

    Monday, November 2, 2009 9:45 AM

Answers

  • Hi Vema!

    What is the criteria to determine that a certain folder is what you need?
    If given the PST file name, then you can use the following check:


    string pstFile;
    Outlook.Namespace olkNamespace = this.Application.GetNamespace("MAPI");

    foreach (Outlook.MAPIFolder folder in olkNamespace.Folders)
    {
        bool folderFound = false;

        if (folder.Store.FilePath == pstFile)
        {
            folderFound = true;
        }
    }

    • Proposed as answer by Jose Anton Bautista Monday, November 2, 2009 10:01 AM
    • Marked as answer by Vema Wednesday, November 4, 2009 10:58 AM
    Monday, November 2, 2009 10:01 AM

All replies

  • Hi Vema!

    What is the criteria to determine that a certain folder is what you need?
    If given the PST file name, then you can use the following check:


    string pstFile;
    Outlook.Namespace olkNamespace = this.Application.GetNamespace("MAPI");

    foreach (Outlook.MAPIFolder folder in olkNamespace.Folders)
    {
        bool folderFound = false;

        if (folder.Store.FilePath == pstFile)
        {
            folderFound = true;
        }
    }

    • Proposed as answer by Jose Anton Bautista Monday, November 2, 2009 10:01 AM
    • Marked as answer by Vema Wednesday, November 4, 2009 10:58 AM
    Monday, November 2, 2009 10:01 AM
  • Thank you.

    I am getting a new error when I try to set remainder for a mailitem that is inside a folder parallel to user inbox (using a pst file)

    item is in a folder that does not support remainders

    How can I resolve the issue?
    Wednesday, November 4, 2009 11:00 AM