none
Delete Outlook 2010 calendar items via VB.NET 2010 automation RRS feed

  • Question

  • Hi guys,

    I am creating a WPF window that would take two date values and checks whether already allocated annual leave appointments have been set to and in between those two dates in Outlook calendar. The dates are input via DatePicker controls, one for the start date, the other for end date. If they do exist, I wish to remove those appointments. I desperately need a solution for this and would be grateful to anyone who can help.

    Many thanks!


    • Edited by jjb1989 Tuesday, September 4, 2012 7:11 AM
    Tuesday, September 4, 2012 7:11 AM

Answers

  • The solution exists within the Outlook Object Model.  I would use a MAPITable object using the Restrict method with a filter on the End and Start date values.  Alternately, you can use the Items.Restrict method but it'll be slower and not ideal for a Calendar with hundreds of items.

    Here's a great example to get you started:

    How to: Search the Calendar for Appointments Within a Date Range that Contain a Specific Word in the Subject:
    http://msdn.microsoft.com/en-us/library/ff867729.aspx


    Eric Legault MVP (Outlook)
    About me...
    Try Outlook Appins - affordable and easy to use!

    Tuesday, September 4, 2012 3:21 PM
    Moderator

All replies

  • The solution exists within the Outlook Object Model.  I would use a MAPITable object using the Restrict method with a filter on the End and Start date values.  Alternately, you can use the Items.Restrict method but it'll be slower and not ideal for a Calendar with hundreds of items.

    Here's a great example to get you started:

    How to: Search the Calendar for Appointments Within a Date Range that Contain a Specific Word in the Subject:
    http://msdn.microsoft.com/en-us/library/ff867729.aspx


    Eric Legault MVP (Outlook)
    About me...
    Try Outlook Appins - affordable and easy to use!

    Tuesday, September 4, 2012 3:21 PM
    Moderator
  • Hi jjb1989,

    Thanks for posting in the MSDN Forum.

    I will mark Eric's reply as answer due to I think it is good enough. Please feel free to unmark it if you feel it doesn't help you.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    Wednesday, September 12, 2012 2:50 AM
    Moderator