【问题标题】:VSTO - Recurring item popup statusVSTO - 重复项目弹出状态
【发布时间】:2022-01-23 17:44:22
【问题描述】:

我有一些定期会议(属性 IsRecurring = 1),当我想删除一些会议时,我得到“打开重复项目”弹出窗口,我想捕捉状态 - 如果我只想打开这个(1)或整个系列(2)。

试过了:

currentExplorer.SelectionChange += new ExplorerEvents_10_SelectionChangeEventHandler(CurrentExplorer_Event); currentExplorer.ViewSwitch += new ExplorerEvents_10_ViewSwitchEventHandler(ViewSwitch_Event);

此事件未捕获选择状态。 获取此信息的最佳方式是什么?

【问题讨论】:

    标签: c# vsto outlook-addin


    【解决方案1】:

    跟踪Inspectors.NewInspector 事件。从那里,您可以使用Inspector.CurrentItem 属性访问AppointmentItem 对象。读取 RecurrenceState 属性 - 可能的值为 olApptOccurrenceolApptExceptionolApptMasterolApptNotRecurring

    【讨论】:

    • 如果我通过 olApptNotRecurring 检查状态 - 它可以告诉我我选择了 - 只有这一个选项?
    • 在这种情况下,约会不是定期约会。
    • 如果是olApptNotRecurring,您将不会从屏幕截图中获得提示。如果您选择“仅此一个”,您将获得olApptOccurrenceolApptException。如果是“整个系列”,您将拥有olApptMaster。试试看。
    【解决方案2】:

    没有办法知道开箱即用的对话框中究竟选择了哪个。您可以做的最好的事情是处理NewInspector 事件并检查RecurrenceState 属性,该属性返回一个OlRecurrenceState 常量,指示指定对象的重复属性。

    对于Just this one 选项,该值应为olApptOccurrence,这意味着该约会是由主约会定义的重复约会。

    如果是整个系列,您可能会找到一个主约会 (olApptMaster)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-04-20
      • 1970-01-01
      • 1970-01-01
      • 2019-09-27
      • 2012-06-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多