5

I am creating simple app for appointments scheduling and I want to implement ability for me to create appointments for my users.

I managed to create,update and delete my calendar on Exchange Server, and I somewhat managed to create appointments adding my colleagues as RequiredAttendees like so:

//service variable is being created using my credidentals
Appointment meeting = new Appointment(service);
meeting.Subject = "Some subject ";
meeting.Body = "Some body.";
meeting.Start = DateTime.Now;
meeting.End = meeting.Start.AddHours(4);
meeting.Location = "Some Location";
meeting.RequiredAttendees.Add("[email protected]");

meeting.ReminderMinutesBeforeStart = 60;
meeting.Save(new FolderId(WellKnownFolderName.Calendar,
    "[email protected]"),
    SendInvitationsMode.SendToAllAndSaveCopy);

But it is just setting him as required attendee. Next thing is I tried using impersonation, but I can't access hosting server to set myself as master and others to have to share calendar with me (due to permissions and stuff) so I had to scrape that as well. Also, he set me up to be his publishing author on his calendar. Is there something I am missing, or can't seem to find on MSDN sites?

EDIT: I am able to create appointment in his calendar in outlok.

0

1 Answer 1

5

If anyone comes across same issues as I did in here please follow these steps:

  1. Make sure that person for which you are creating appointment sets you up (on exchange server or in outlok as "Editing author" with all permissions.

  2. After that you can create appointments for him (verify this by going to your outlok and creating some test appointments).

This code works for me:

Folder inboxFolder = Folder.Bind(service, new FolderId(WellKnownFolderName.Calendar, "[email protected]"));
Appointment appointmentOther = new Appointment(service);
appointmentOther.Subject = "Test 2";
appointmentOther.Body = "Body text";
appointmentOther.Start = DateTime.Now;
appointmentOther.End = DateTime.Today.AddHours(16);
appointmentOther.Location = "My Office";
appointmentOther.IsReminderSet = true;
appointmentOther.ReminderMinutesBeforeStart = 30;
appointmentOther.Save(inboxFolder.Id,SendInvitationsMode.SendToNone);

Good luck :)

2
  • 1
    "Editing author" does not exist according to the MS site: technet.microsoft.com/de-de/library/ff522363(v=exchg.160).aspx - But the solution works! +1 Nov 17, 2017 at 21:16
  • @Al Bundy Yeah, at one point I found that there are few versions of documentation somewhere in depths of internet, but managed to find solution somehow. I am glad it helped :)
    – Kadaj
    Nov 23, 2017 at 11:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.