Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 631669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:59:28+00:00 2026-05-13T19:59:28+00:00

I’m searching for CalendarItems with Exchange Web Services. In the documentation on MSDN there

  • 0

I’m searching for CalendarItems with Exchange Web Services. In the documentation on MSDN there is a field named LastModifiedTime.

How do I query CalendarItems by LastModifiedTime with Exchange Server Bindings?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T19:59:29+00:00Added an answer on May 13, 2026 at 7:59 pm

    I found out a way with using restictions

    (but by searching
    If findItemRequest object’s
    findItemRequest.Item
    findItemRequest.Restictions properties are defined
    It gives combination error…)

    If only Item or Restictions is defined for findItemRequest object it works

            List<CalendarInfo> calendarEvents = new List<CalendarInfo>();
    
            ExchangeServiceBinding esb = EWS.Helper.ExchangeHelper.GetExchangeBinding(credentials);
    
            // Form the FindItem request.
            FindItemType findItemRequest = new FindItemType();
    
    
            CalendarViewType calendarView = new CalendarViewType();
            calendarView.StartDate = criteria.StartDateAndTime;
            calendarView.EndDate = criteria.EndDateAndTime;
    
            if (criteria.MaxItemsToReturn > 0)
            {
                calendarView.MaxEntriesReturned = criteria.MaxItemsToReturn;
                calendarView.MaxEntriesReturnedSpecified = true;
            }
    
            findItemRequest.Item = calendarView;
    
            //--
            PathToExtendedFieldType sySyncProp = new PathToExtendedFieldType();
    
    
    
            sySyncProp.PropertyTag = "0x3008";
            sySyncProp.PropertyType = MapiPropertyTypeType.SystemTime;
            // Define restrictions
    
            RestrictionType ffRestriction = new RestrictionType();
            IsGreaterThanOrEqualToType ieGreater = new IsGreaterThanOrEqualToType();
    
            ieGreater.FieldURIOrConstant =  new FieldURIOrConstantType();
            ieGreater.FieldURIOrConstant.Item = new ConstantValueType();
            (ieGreater.FieldURIOrConstant.Item as ConstantValueType).Value = DateTime.Now.AddDays(-1).ToUniversalTime().ToString("u");
            ieGreater.Item = sySyncProp;
    
            ffRestriction.Item = ieGreater;
    
           findItemRequest.Restriction = ffRestriction;
    
            //--
            // Define which item properties are returned in the response.
            ItemResponseShapeType itemProperties = new ItemResponseShapeType();
    
            // Use the Default shape for the response. 
            itemProperties.BaseShape = DefaultShapeNamesType.AllProperties;
            //insert last modified time value also to responses
            PathToExtendedFieldType[] ptufta = new PathToExtendedFieldType[1];
            ptufta[0] = new PathToExtendedFieldType();
            ptufta[0].PropertyTag = "0x3008"; //Property Tag for LastModifiedTime 
            ptufta[0].PropertyType = MapiPropertyTypeType.SystemTime;
            itemProperties.AdditionalProperties = ptufta;
    
            findItemRequest.ItemShape = itemProperties;
    
            DistinguishedFolderIdType[] folderIDArray = new DistinguishedFolderIdType[1];
            folderIDArray[0] = new DistinguishedFolderIdType();
            folderIDArray[0].Id = DistinguishedFolderIdNameType.calendar;
    
            if (!string.IsNullOrEmpty(criteria.EmailAddress))
            {
                folderIDArray[0].Mailbox = new EmailAddressType();
                folderIDArray[0].Mailbox.EmailAddress = criteria.EmailAddress.Trim();
            }
    
            findItemRequest.ParentFolderIds = folderIDArray;
    
            // Define the traversal type.
            findItemRequest.Traversal = ItemQueryTraversalType.Shallow;
    
            try
            {
                // Send the FindItem request and get the response.
                FindItemResponseType findItemResponse = esb.FindItem(findItemRequest);
    
                // Access the response message.
                ArrayOfResponseMessagesType responseMessages = findItemResponse.ResponseMessages;
                ResponseMessageType[] rmta = responseMessages.Items;
    
                int folderNumber = 0;
    
                foreach (ResponseMessageType rmt in rmta)
                {
                    // One FindItemResponseMessageType per folder searched.
                    FindItemResponseMessageType firmt = rmt as FindItemResponseMessageType;
    
                    if (firmt.RootFolder == null)
                        continue;
    
                    FindItemParentType fipt = firmt.RootFolder;
                    object obj = fipt.Item;
    
                    // FindItem contains an array of items.
                    if (obj is ArrayOfRealItemsType)
                    {
                        ArrayOfRealItemsType items = (obj as ArrayOfRealItemsType);
                        if (items.Items == null)
                        {
                            // Console.WriteLine("Folder {0}: No items in folder", folderNumber);
                            folderNumber++;
                        }
                        else
                        {
                            CalendarInfo ce;
                            CalendarItemType cal;
                            foreach (ItemType it in items.Items)
                            {
    
                                if (it is CalendarItemType)
                                {
                                    cal = (CalendarItemType)it;
                                    ce = GetCalendarInfo(esb, cal);
                                    calendarEvents.Add(ce);
                                }
                                //Console.WriteLine("Folder {0}: Item identifier: {1}", folderNumber, it.ItemId.Id);
    
                            }
    
                            folderNumber++;
                        }
                    }
                }
    
                //Console.ReadLine();
            }
            catch (Exception e)
            {
                throw;
            }
    
    
            return calendarEvents;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.