【问题标题】:Outlook Appointment c#Outlook 约会 c#
【发布时间】:2012-06-20 21:48:31
【问题描述】:

我正在尝试创建一个 Outlook 约会,该约会直接进入用户日历,并将回复发送到不同的电子邮件地址。

这可以使用和LDAP 查询吗?如果没有,我最好的选择是什么?

谢谢 Sp

【问题讨论】:

    标签: c# outlook ldap


    【解决方案1】:

    据我所知,您无法使用 LDAP 执行此操作。您可能想要获取 Exchange Web 服务程序集 (Microsoft.Exchange.WebServices),它包装了交换服务器 Web 服务 API,并允许您轻松地“做一些事情”作为交换。

    例如获取约会的示例代码:

    var service = new ExchangeService { UseDefaultCredentials = true };
    service.AutodiscoverUrl(emailAddress);
    
    // Set the calendar view to use
    var view = new CalendarView(startDate, endDate);
    
    // Get the target folder ID using the email address
    var folder = new FolderId(WellKnownFolderName.Calendar, new Mailbox(emailAddress));
    
    // Get the appointments
    var response = service.FindAppointments(folder, view);
    

    编辑:

    并创建一个-(使用上面的一些代码来获取服务实例):

    var apt = new Appointment(service);
    apt.Start = DateTime.Now;
    // Do other stuff
    apt.Save();
    

    【讨论】:

      【解决方案2】:
      public void addAppointments(String subject,String body,DateTime startTime,DateTime endTime,String location) 
      {
          Appointment app = new Appointment(_service);
          app.Subject = subject;
          app.Body = body;
          app.Start = startTime;
          app.End = endTime;
          app.Location = location;
      
          //DayOfTheWeek[] days = new DayOfTheWeek[] { DayOfTheWeek.Saturday };
          //app.Recurrence = new Recurrence.WeeklyPattern(app.Start.Date, 1, days);
          //app.Recurrence.StartDate = app.Start.Date;
          //app.Recurrence.NumberOfOccurrences = 3;
      
          app.Save();
      }
      

      此方法可用于添加约会。使用 Outlook api。

      此链接也会有所帮助。

      http://social.msdn.microsoft.com/Forums/en-US/outlookdev/thread/7ae6d938-a64f-4c27-95ba-435f84da236f

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2015-06-21
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多