【问题标题】:How to save an outlook appointment in users calendar?如何在用户日历中保存 Outlook 约会?
【发布时间】:2013-08-16 05:56:44
【问题描述】:

我正在开发一个 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 localhost 中本地运行时,代码工作正常,但在服务器上失败。 由于代码在服务器上运行,因此从逻辑上不确定它是否能够在客户端 Outlook 上存储 Outlook 约会。

请指出正确的方向,即使我需要使用不同的方法。

提前致谢。

【问题讨论】:

  • 您服务器上的代码无法访问客户端计算机上的 Outlook。您需要做的是创建一个 VCS 文件,允许客户端下载它,如果他们的机器设置正确,Outlook 将启动并创建约会。

标签: c# asp.net outlook


【解决方案1】:

Outlook 与任何其他 Office 应用程序一样,不能在服务(如 IIS)中使用。 请参阅How to access client's outlook in ASP.net? 了解替代方案。

【讨论】:

    【解决方案2】:

    我总是把它作为给用户的电子邮件。许多在线网站都有将电子邮件转换为会议请求所需的数据,这是一个示例。

    http://sahannet.blogspot.com/2010/09/create-outlook-vcalendar-reminder-file.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-05-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多