English 中文(简体)
Using ExchangeService to Add Appointment Occurances
原标题:

The target is someone s Exchange Calendar (2007). I want to add a simple "Appointment Occurance" to someone s calendar. This code works (I am using the Microsoft.Exchange.WebServices.dll):

service = new ExchangeService(ExchangeVersion.Exchange2007_SP1);
service.Credentials = new NetworkCredential("supervisor", "password", "DOMAIN.COM");
service.AutodiscoverUrl("<employee@domain.com>", ValidateRedirectionUrlCallback);
appt = new Appointment(service);
appt.Subject = "<subject>";
appt.Body = "<Body Text>";
appt.Start = _DateFrom;
appt.End = _DateTo;
appt.Sensitivity = Sensitivity.Private;
appt.Save(WellKnownFolderName.Calendar);

However, there are problems with this code:

  1. The appointment target is the employee. When adding the appointment, the appointment shows up for the employee (yay!) but also for the supervisor (boo!). Am I supposed to use the employee s credentials? If so, what if I do not have access to that - only the supervisors, am I out of the game already?
  2. The appointment shows up in Outlook as a "Meeting Appointment" and not and "Appointment Occurrence". So, the box to input meeting attendees is showing (with no one in it of course), and is irrelevant in my scenario.
  3. appt.Body does not respond at all to Environment.NewLine or " " - I haven t tried HTML yet.
问题回答

Instead of WellKnownFolderName.Calendar

You should use new FolderId(WellKnownFolderName.Calendar,"employee@domain.com")

So the last line becomes appt.Save(new FolderId(WellKnownFolderName.Calendar,"employee@domain.com"));

Also having problems with the newline, this is only since version 1.1 so it probebly is a bug





相关问题
Exchange Server and SAS 9.1.3/9.2

has anyone successfully interacted with a microsoft exchange server in SAS 9.1.3 or 9.2? i know it can be done with SAS Ent. Guide 4.x, but i m not interested in that route if regular SAS can do it.

What is better practice for error notification by email

This question is language independent. I have an application that handles requests in a loop. During this loop for each request multiple actions are taken. These actions are sitting inside try / ...

getting access to outlook exchange global address book

i am building a csharp application and i would like a dropdown list of all users in my outlook global address book (the same one when i click on To: from outlook gui. is this possible to get this ...

Quitting Fasthosts and Need a Managed Email Provider

Fasthosts email service has been down all day so both us and our clients have been without email. Not really good news for a web development company. Even their site is down! After the fiasco the ...

热门标签