none
EWS managed API delete items RRS feed

  • Question

  • Hello everyone

    I have a problem and I don't know how to solve it.

    I'm developing an application to create, delete and edit calendar events on a mailbox calendar. I can create events without problem, I use an account to connect to the exchange server and I use impersonation with the current user logged in my application. To delete a calendar event I use the StoreId from calendarEvent.Details.StoreId and then I use this code to do the conversion.

     

     Microsoft.Exchange.WebServices.Data.AlternateId[] ai = new Microsoft.Exchange.WebServices.Data.AlternateId[1];
                    ai[0] = new Microsoft.Exchange.WebServices.Data.AlternateId();
                    ai[0].UniqueId = item.StoredId;
                    ai[0].Format = Microsoft.Exchange.WebServices.Data.IdFormat.HexEntryId;
                    ai[0].Mailbox = item.RoomAddress;
                    Microsoft.Exchange.WebServices.Data.ServiceResponseCollection<Microsoft.Exchange.WebServices.Data.ConvertIdResponse> cvtresp = this.exchangeServiceBinding.ConvertIds(ai, Microsoft.Exchange.WebServices.Data.IdFormat.EwsId);

                   
                    var unique = ((Microsoft.Exchange.WebServices.Data.AlternateId)cvtresp[0].ConvertedId).UniqueId;

     

    After that I use the uniqueId to bind the appointment and I get it correctly, when I try to delete it I get an exception that I can't delete the object.

     

    Can anybody help me? I'm really stuck here. Thanks a lot!

    Wednesday, September 5, 2012 11:01 AM

All replies

  • What is the exception that you get ?

    Do you have full editor rights to the calendar you trying to modify.

    If this is a Meeting Room Mailbox then you can't impersonate a Meeting Room Mailbox by default because they are disabled and you can't impersonate a disabled account (well you can but you just impersonate the disabled status which will then fail).

    Glen

    Thursday, September 6, 2012 4:38 AM