[英]How to save an outlook appointment in users calendar?
我正在开发一个asp.net Web应用程序,该应用程序允许用户使用以下代码将任何事件从gridView同步到Outlook约会:
private void generateOutlookAppointment(string subject, string location, string startDate, string endDate)
{
string body = "Test Data for Body.";
Outlook.Application outlookApp = new Outlook.Application();
Outlook.AppointmentItem oAppointment = (Outlook.AppointmentItem)outlookApp.CreateItem(Outlook.OlItemType.olAppointmentItem);
oAppointment.Subject = subject;
oAppointment.Body = body ;
oAppointment.Location = location;
oAppointment.Start = DateTime.Parse(startDate).AddHours(9);
oAppointment.End = DateTime.Parse(endDate).AddHours(9);
oAppointment.ReminderSet = true;
oAppointment.ReminderMinutesBeforeStart = 15;
oAppointment.Importance = Outlook.OlImportance.olImportanceHigh;
oAppointment.BusyStatus = Outlook.OlBusyStatus.olBusy;
oAppointment.Save();
}
当我在Visual Studio本地主机中本地运行时,代码工作正常,但在服务器上失败。 从逻辑上讲,由于代码在服务器上运行,因此不能在客户端Outlook上存储Outlook约会。
即使在我需要使用其他方法的情况下,也请指出正确的方向。
提前致谢。
与其他Office应用程序一样,Outlook也不能在服务(例如IIS)中使用。 请参阅如何在ASP.net中访问客户端的外观? 供选择。
我总是以电子邮件的形式发送给用户。 许多在线站点具有将电子邮件转换为会议请求所需的必需数据,这是一个示例。
http://sahannet.blogspot.com/2010/09/create-outlook-vcalendar-reminder-file.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.