首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何从单个事件中获取Outlook约会系列主页

如何从单个事件中获取Outlook约会系列主页
EN

Stack Overflow用户
提问于 2013-02-07 20:20:19
回答 2查看 1.9K关注 0票数 2

当打开一个约会实例时,我需要获取会议系列的主约会。

我尝试过以下方法(currentAppointment变量的类型为AppointmentItem)

代码语言:javascript
运行
复制
DateTime sd = currentAppointment.GetRecurrencePattern().PatternStartDate;
DateTime st = currentAppointment.GetRecurrencePattern().StartTime;

AppointmentItem ai = currentAppointment.GetRecurrencePattern().GetOccurrence(sd+st.TimeOfDay);

然而,虽然这让我获得了本系列中的第一个约会,但它的RecurrenceState为olApptOccurrence。

我如何才能获得olApptMaster -即会议系列的参考资料?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2013-02-07 21:41:25

AppointmentItem.Parent将返回重复实例和异常的父AppointmentItem。

票数 6
EN

Stack Overflow用户

发布于 2013-02-07 20:29:02

我有一个方法来创建一个定期约会项目,但它几乎与修改一个一样,告诉我这是否对你有帮助,如果你需要进一步的信息。

以下是C#中的代码

代码语言:javascript
运行
复制
private void CreateNewRecurringAppointment(Outlook._Application OutlookApp) 
{ 
    Outlook.AppointmentItem appItem = null; 
    Outlook.RecurrencePattern pattern = null; 
    try 
    { 
        appItem = OutlookApp.CreateItem(Outlook.OlItemType.olAppointmentItem) 
           as Outlook.AppointmentItem; 
        // create a recurrence 
        pattern = appItem.GetRecurrencePattern(); 
        pattern.RecurrenceType = Outlook.OlRecurrenceType.olRecursWeekly; 
        pattern.StartTime = DateTime.Parse("9:00:00 AM"); 
        pattern.EndTime = DateTime.Parse("10:00:00 AM"); 
        // we can specify the duration instead of using the EndTime property 
        // pattern.Duration = 60; 
        pattern.PatternStartDate = DateTime.Parse("11/11/2011"); 
        pattern.PatternEndDate = DateTime.Parse("12/25/2011"); 
        appItem.Subject = "Meeting with the Boss"; 
        appItem.Save(); 
        appItem.Display(true); 
    } 
    catch (Exception ex) 
    { 
        System.Windows.Forms.MessageBox.Show(ex.Message); 
    } 
    finally 
    { 
        if (pattern != null) 
           System.Runtime.InteropServices.Marshal.ReleaseComObject(pattern); 
        if (appItem != null) 
           System.Runtime.InteropServices.Marshal.ReleaseComObject(appItem); 
    } 
} 

来源:http://www.add-in-express.com/creating-addins-blog/2011/11/07/outlook-recurring-appointment/

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14750975

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档