locked
[E2010][EWSMA][C#] Get the Mailbox property on a FolderID RRS feed

  • Question

  • I have a streaming notifications listener that's subscribed to multiple mailboxes. When a creation notification comes in, I bind to the created item to try to learn more about it. I try to look at the ParentDirectoryID.Mailbox to try to figure out where the item is being created in, but it's null. The API says that the Folder ID and the FolderName/Mailbox properties are mutually exclusive. So, how do I load the FolderName/Mailbox properties?
    Tuesday, July 5, 2011 8:12 PM

Answers

  • Hi,

    you don't need the mailbox id, if you have an item id (or a folder Id). Just call

    var item = Item.Bind(service, new ItemId(uniqueId))

    or

    var folder = Folder.Bind(service, new FolderId(uniqueId));

    where uniqueId is the id of the item/folder.

    Kind regards,
    Henning

    "Tedderz" wrote in message news:66d2c6b5-89ee-46f5-8e3e-1a6b7d3998fa@communitybridge.codeplex.com...

    I have a streaming notifications listener that's subscribed to multiple mailboxes. When a creation notification comes in, I bind to the created item to try to learn more about it. I try to look at the ParentDirectoryID.Mailbox to try to figure out where the item is being created in, but it's null. The API says that the Folder ID and the FolderName/Mailbox properties are mutually exclusive. So, how do I load the FolderName/Mailbox properties?

    • Marked as answer by Tedderz Monday, July 18, 2011 12:46 PM
    Tuesday, July 5, 2011 8:26 PM

All replies

  • Hi,

    you don't need the mailbox id, if you have an item id (or a folder Id). Just call

    var item = Item.Bind(service, new ItemId(uniqueId))

    or

    var folder = Folder.Bind(service, new FolderId(uniqueId));

    where uniqueId is the id of the item/folder.

    Kind regards,
    Henning

    "Tedderz" wrote in message news:66d2c6b5-89ee-46f5-8e3e-1a6b7d3998fa@communitybridge.codeplex.com...

    I have a streaming notifications listener that's subscribed to multiple mailboxes. When a creation notification comes in, I bind to the created item to try to learn more about it. I try to look at the ParentDirectoryID.Mailbox to try to figure out where the item is being created in, but it's null. The API says that the Folder ID and the FolderName/Mailbox properties are mutually exclusive. So, how do I load the FolderName/Mailbox properties?

    • Marked as answer by Tedderz Monday, July 18, 2011 12:46 PM
    Tuesday, July 5, 2011 8:26 PM
  • Well, I believe I do need to get the Mailbox property so that I can determine which mailbox this item is being created in. I can call Bind() just fine, but that just gives me some other first class properties. How do I determine the e-mail address of the mailbox that the item is in?
    Tuesday, July 5, 2011 8:46 PM