C# VSTO Outlook从草稿发送会议项目

C# VSTO Outlook从草稿发送会议项目,c#,outlook,vsto,outlook-addin,C#,Outlook,Vsto,Outlook Addin,我正在开发我的插件,面临着下一个问题:看起来,MeetingItems的工作方式与MailItems不同 我需要做的是: 在发送会议项目之前将其保存到草稿 添加附件 发送它 1将会议项目保存到草稿: (Item as MeetingItem).GetAssociatedAppointment(false).GetInspector.Close(OlInspectorClose.olSave); (Item as MeetingItem).Send(); << it doesn't

我正在开发我的插件,面临着下一个问题:看起来,MeetingItems的工作方式与MailItems不同

我需要做的是:

  • 在发送会议项目之前将其保存到草稿
  • 添加附件
  • 发送它
  • 1将会议项目保存到草稿:

    (Item as MeetingItem).GetAssociatedAppointment(false).GetInspector.Close(OlInspectorClose.olSave);
    
    (Item as MeetingItem).Send();  << it doesn't work.
    
    AppointmentItem appItem = Item.GetAssociatedAppointment(false);
    appItem.Send(); << It works. But MeetingItem is still in drafts folder (???)
    Item.Delete(); << Moved to deleted folder, and can't delete permanently.
    
    它起作用了

    2。添加附件。

    Attaches = (Item as MeetingItem).GetAssociatedAppointment(false).Attachments;
    Attaches.Add(...).
    
    它也起作用

    3。发送邮件。

    Attaches = (Item as MeetingItem).GetAssociatedAppointment(false).Attachments;
    Attaches.Add(...).
    
    Try1:

    (Item as MeetingItem).GetAssociatedAppointment(false).GetInspector.Close(OlInspectorClose.olSave);
    
    (Item as MeetingItem).Send();  << it doesn't work.
    
    AppointmentItem appItem = Item.GetAssociatedAppointment(false);
    appItem.Send(); << It works. But MeetingItem is still in drafts folder (???)
    Item.Delete(); << Moved to deleted folder, and can't delete permanently.
    
    但是当我发送邮件时,我应该使用

    (Item as MailItem).GetAssociatedAppointment(false).Attachments.Add(...)
    

    这令人困惑。

    会议项目不是为用户保存或操作而设计的,而是在发送约会时自动创建的。您确实需要向约会本身添加附件。如果您仍然只想将它们放在会议项目上,您可以处理
    应用程序.ItemSend
    事件,并将附件添加到传递给事件处理程序的
    MeetingItem
    对象中。

    会议项目不是为用户保存或操纵而设计的-它们是在发送约会时自动创建的。您确实需要向约会本身添加附件。如果您仍然只想将它们放在会议项目上,则可以处理Application.ItemSend事件,并将附件添加到传递给事件处理程序的
    MeetingItem
    对象中。

    无需使用MeetingItem类的方法。通过调用MeetingItem类的属性,可以直接获取Inspector类的实例。同样的规则也适用于需要调用的其他属性和方法-,等等


    以编程方式创建会议请求时,首先创建
    AppointmentItem
    对象,而不是
    MeetingItem
    对象。要指示约会是会议,请将
    AppointmentItem
    对象的
    MeetingStatus
    属性设置为olMeeting。要发送会议请求,请将
    send
    方法应用于该
    AppointItem
    对象。

    无需使用MeetingItem类的方法。通过调用MeetingItem类的属性,可以直接获取Inspector类的实例。同样的规则也适用于需要调用的其他属性和方法-,等等

    以编程方式创建会议请求时,首先创建
    AppointmentItem
    对象,而不是
    MeetingItem
    对象。要指示约会是会议,请将
    AppointmentItem
    对象的
    MeetingStatus
    属性设置为olMeeting。要发送会议请求,请将
    send
    方法应用于该
    AppointmentItem
    对象