none
Can you filter appointments by urn:schemas:calendar:rdate RRS feed

  • Question

  • Hi 

    Is it possible to filter appointments by urn:schemas:calendar:rdate ?

    As I understand it this represents an array of datetimes on which the recurring appointment occurs

    So can those be tested against a date and if any match it will be true ?

    Thanks

    Tuesday, October 22, 2019 12:56 PM

All replies

  • Yes. Make sure you set the Items.IncludeRecurrences property to true. See https://docs.microsoft.com/en-us/office/vba/api/outlook.items.includerecurrences


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!


    Wednesday, October 23, 2019 2:39 PM
  • Thanks for the reply

    Can you show me a working VB example that filters using 

    urn:schemas:calendar:rdate

    as i'm not sure what operator to use ? is it something like contains ?

    Wednesday, October 23, 2019 2:43 PM
  • See the example at https://docs.microsoft.com/en-us/office/vba/api/outlook.items.includerecurrences

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Wednesday, October 23, 2019 2:54 PM
  • Thanks

    But that example uses START date NOT RECURRANCE date

    I'm talking about this

    https://docs.microsoft.com/en-us/previous-versions/office/developer/exchange-server-2003/ms991476(v%3Dexchg.65)

    But using with Restrict

    Wednesday, October 23, 2019 3:03 PM
  • If you use the Start property, OOM will make it work both for the single instance and recurring appointments.

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Wednesday, October 23, 2019 3:53 PM
  • Thanks

    Not to worry

    If you look at the last post in this long thread

    https://answers.microsoft.com/threadauth/d6ccfe32-5779-4d3c-8279-2ab52ee0f4c2/messages/54bcc6e8-e6c5-42e2-ae43-15b2ba0ae7b5

    You will see "Microsoft" acknowledge that the Advanced find does not work with shared calendars

    I was just wondering having stumbled across the recurrence date field in DASL it might help

    I've got pretty close in code but it's not quite 100%

    It is amazing that in 2019 Outlook cannot do a search and return only today's (or date range) appointments as you would see them in the calendar, but it can't !

    Wednesday, October 23, 2019 4:07 PM
  • Are you using AdvancedFind? Or is is Items.Find/FindNext/Restrcit?

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Wednesday, October 23, 2019 4:13 PM
  • I was writing code using Items.Restrict but not getting the results I wanted

    I tried the same test in Advanced Find and got the same incorrect results so I assume it uses the same engine

    So I started the other thread to ask why does it not work(ruling out my code), and they eventually acknowledged it does not work

    I just have to assume no-one really uses Restrict with date ranges or Advanced Find or is not that bothered that it does not return the correct result

    It does seem extraordinary though


    Thursday, October 24, 2019 8:20 AM
  • I have managed to produce some code that "works" but it is so slow it effectively does not

    The shared calendar in a public folder in question has about 21000 entries in it

    I can set a restrict date filter that gets me almost all of the appointments  (plus many I don't) I need except it misses any daily appointments that occur

    I can add a DASL string to the restrict it includes all the daily recurring appointments that would have otherwise been missed

    However I now have about 380 appointments to process, check if they are recurring, if they are call GetOccurrence on each appointment, for each day in my range to see if that recurrence falls in the valid range

    At the end of it I have the 25 appointments that ACTUALLY occur in the week I am interested in

    The problem is it takes over 7 minutes to deduce this, which effectively means it does not work

    The infuriating thing is if I have work week open in outlook and skip very rapidly back through the weeks it refreshes the view within a couple of seconds so obviously outlook has a way of getting all the correct appointments for a given time period very quickly from the shared calendar .... just wish I knew how it did it !

    Thursday, October 24, 2019 11:24 AM
  • I just tried a quick test and just simply looping through those 380 items and getting just one property value each time still takes approximately 1.5 minutes

    So how Outlook manages to do it in the blink of an eye they must be using a very different interface

    At that rate even if I was only getting the 25 I wanted it would be over 6 seconds


    Thursday, October 24, 2019 1:04 PM
  • Who is "they"? What is your code using Start and  IncludeRecurrences that does not work?

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Thursday, October 24, 2019 1:47 PM
  • They = Microsoft

    The code (or advanced find) does not work in that you get all of the appointments that are within your range PLUS all recurring appointments regardless of if they occur within your date range EXCEPT if they are daily recurring ones in which case you don't get any of them

    So you can't simply say give me today's appointments or one weeks appointments next month etc it simply wont return JUST the appointments you are interested in where the calendar is an Exchange public shared calendar that appears in Outlook under Other Calendars

    Thursday, October 24, 2019 1:55 PM