如何在发送后移动MeetingItem

如何在发送后移动MeetingItem

本文介绍了如何在发送后移动MeetingItem?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我成功地将MailItem对象移动到某个文件夹后发送信​​件。但我找不到使用MeetingItem的方法(比如我创建一个会议并发送邀请函 - 我希望邀请函{MeetingItem}自动
移动到某个文件夹)。

I am successfully moving MailItem objects, just after sending a letter, to a certain folders. But I can't find a way to do that with MeetingItem (say I create a meeting and send invitations to it - I want the invitation letter {MeetingItem} to be automatically moved to a certain folder).

如果我使用与MailItems相同的逻辑,那就是:

If I use the same logic that I use for MailItems, which is this:

   

Private meeting As Outlook.MeetingItem

Private Sub Application_ItemSend(ByVal Item As Object,Cancel As Boolean)

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)

If TypeName(Item)=" MeetingItem"然后
设置会议=项
设置objNS = Application.GetNamespace(" MAPI")
Dim olFolder As Outlook.MAPIFolder
设置olFolder = objNS.Folders(account).Folders ("一切")。文件夹("会议和约会")
如果不是olFolder则没有那么
meeting.Move olFolder
结束如果
结束如果

If TypeName(Item) = "MeetingItem" Then Set meeting = Item Set objNS = Application.GetNamespace("MAPI") Dim olFolder As Outlook.MAPIFolder Set olFolder = objNS.Folders(account).Folders("EVERYTHING").Folders("Meetings & appointments") If Not olFolder Is Nothing Then meeting.Move olFolder End If End If

{...}

我收到以下错误:

无法执行操作,因为该对象已被删除。

The operation cannot be performed because the object has been deleted.

有趣的是,当会议窗口仍处于打开状态时,此过程将触发 - 它会运行代码,将项目移动到文件夹,然后出现此错误。

Interesting is that this procedure fires while the meeting window is still open - it runs through the code, moves the item to folder, and then this error appear.

我还试图使用事件"AfterWrite"和"关闭",但他们不允许使用MeetingItem的任何方法,所以我实际上无法移动它。我还尝试使用检查器捕获会议窗口的实际关闭
然后执行移动,但仍然没有运气。

I have also tried to use events "AfterWrite" and "Close", but they wouldn't allow any methods of MeetingItem to be used, so I can't actually move it. I have also tried to use an inspector to capture the actual closing of the Meeting window and then perform the movement, but still no luck.

你能告诉我怎么可能我自动移动这些已发送的会议请求?

Could you please advice me how could I automatically move these sent meeting requests?

提前感谢您的任何建议!

Thank you in advance for any advice!

推荐答案


这篇关于如何在发送后移动MeetingItem?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 10:09