有没有更好的方法在bot应用程序中启动Outlook添加约会窗口?

时间:2019-03-12 11:57:37

标签: outlook botframework cortana

我需要在bot应用程序中启动Outlook日历约会。我在Microsoft文档中找到了以下代码来启动Outlook电子邮件。

var message = context.MakeMessage() as IMessageActivity;
message.ChannelData = JObject.FromObject(new
{
  action = new { type = "LaunchUri", uri = "mailto:someone@example.comsubject=This%20is%20the%20subject&body=This%20is%20t e%20body"
   } 
 });
   await context.PostAsync(message);

我也尝试了Microsoft.Office.Interop.Outlook添加约会,这对我也不起作用。

            Outlook.Application outlookApp = new Outlook.Application(); // creates new outlook app
            Outlook.AppointmentItem oAppointment = (Outlook.AppointmentItem)outlookApp.CreateItem(Outlook.OlItemType.olAppointmentItem); // creates a new appointment
            oAppointment.Subject = apt.Subject;
            oAppointment.Body = apt.Body;
            oAppointment.Location = apt.Location;
            oAppointment.Start = Convert.ToDateTime(apt.StartTime);
            oAppointment.End = Convert.ToDateTime(apt.EndTime);

有没有更好的方法来启动Outlook日历约会。

0 个答案:

没有答案