Reputation: 851
I'm hoping you can help me. I'm looking into using the EWS to automatically manage some calender appointments.
To help me with this I've downloaded the code samples from here: MSDN - Exchange 2013 101 Code Samples
They are helpful, however when I run exercise "Exchange 2013 Create weekly recurring appointments on Exchange servers" it is putting the event into a secondary calender I have access to rather than the primary for my user account.
I tried changing the save code to be this:
appointment.Save(new FolderId(WellKnownFolderName.Calendar));
yet it still goes to the wrong calender. As far as I'm aware my user account shouldn't even have access to the calender it is adding it, but I have it set up as a secondary outlook account.
So this raises the question, I'm connecting to EWS as the current logged on user (my user account). But why is it not saving to my primary calendar? In turn, how does it find the other calenders and decide which it should save against?
Hope you can help, if you need more info just ask :-)
Nik
Upvotes: 0
Views: 3513
Reputation: 8889
Well, it's pretty old question,
but searched for this as well, and this is the solution for who might need it:
you need to find the folder id first, then
appointment.Save(CustomCalendarFolder.Id,SendInvitationsMode.SendToNone);
Upvotes: 0
Reputation: 17702
Enable tracing to see the full SOAP request that is getting sent to the server. There must be something in there that is directing this to the other mailbox.
Upvotes: 0
Reputation: 949
You need to impersonate as the user you want, find his calender, and then add your appointment. Microsoft actually has an example that does exactly that.
Upvotes: 1
Reputation: 2535
Have you take a look at this links:
The first link have some code on how to set appointment with attendees. Hope this will help you.
Upvotes: 0