none
Fetch folder Creation and Modification Date using EWS RRS feed

  • Question

  • Hi all,

    I need to fetch the date of creation and modification of a Mailbox folder  using EWS.

    How can i do that ?

    Thanks,

    Gagan


    Gagan

    Thursday, July 17, 2014 7:55 AM

Answers

  • You can just use the Extended Mapi properties to do this eg

                ExtendedPropertyDefinition PR_CREATION_TIME = new ExtendedPropertyDefinition(0x3007,MapiPropertyType.SystemTime);
                ExtendedPropertyDefinition PR_LAST_MODIFICATION_TIME = new ExtendedPropertyDefinition(0x3008, MapiPropertyType.SystemTime);
                PropertySet psProps = new PropertySet(BasePropertySet.FirstClassProperties) { PR_CREATION_TIME, PR_LAST_MODIFICATION_TIME };
                Folder Inbox = Folder.Bind(service, WellKnownFolderName.Inbox, psProps);
                DateTime PR_CREATION_TIMEVal;
                DateTime PR_LAST_MODIFICATION_TIMEVal;
                if (Inbox.TryGetProperty(PR_CREATION_TIME, out PR_CREATION_TIMEVal)) {
                    Console.WriteLine(PR_CREATION_TIMEVal.ToString());
                }
                if (Inbox.TryGetProperty(PR_LAST_MODIFICATION_TIME, out PR_LAST_MODIFICATION_TIMEVal)) {
                    Console.WriteLine(PR_LAST_MODIFICATION_TIMEVal.ToString());
                }

    Cheers
    Glen

    Friday, July 18, 2014 6:32 AM

All replies

  • You can just use the Extended Mapi properties to do this eg

                ExtendedPropertyDefinition PR_CREATION_TIME = new ExtendedPropertyDefinition(0x3007,MapiPropertyType.SystemTime);
                ExtendedPropertyDefinition PR_LAST_MODIFICATION_TIME = new ExtendedPropertyDefinition(0x3008, MapiPropertyType.SystemTime);
                PropertySet psProps = new PropertySet(BasePropertySet.FirstClassProperties) { PR_CREATION_TIME, PR_LAST_MODIFICATION_TIME };
                Folder Inbox = Folder.Bind(service, WellKnownFolderName.Inbox, psProps);
                DateTime PR_CREATION_TIMEVal;
                DateTime PR_LAST_MODIFICATION_TIMEVal;
                if (Inbox.TryGetProperty(PR_CREATION_TIME, out PR_CREATION_TIMEVal)) {
                    Console.WriteLine(PR_CREATION_TIMEVal.ToString());
                }
                if (Inbox.TryGetProperty(PR_LAST_MODIFICATION_TIME, out PR_LAST_MODIFICATION_TIMEVal)) {
                    Console.WriteLine(PR_LAST_MODIFICATION_TIMEVal.ToString());
                }

    Cheers
    Glen

    Friday, July 18, 2014 6:32 AM
  • This worked for me ! :)

    Thanks Glen,

    Regards,

    Gagan


    Gagan

    Friday, July 18, 2014 1:17 PM