【发布时间】:2020-09-09 15:06:27
【问题描述】:
我想在我关闭邮件项时获取后续标志对话框和类别对话框以设置提醒。
我试图从here 修改代码。当我关闭一个邮件项目时,一切都保持正常,我得到了类别对话框。我无法获得this 等后续标志的对话框。没有错误消息弹出。
Public WithEvents objInspector As Outlook.Inspector
Public WithEvents colInspectors As Outlook.Inspectors
Private Sub Application_Startup()
Init_colInspectorsEvent
End Sub
Private Sub Application_ItemLoad(ByVal Item As Object)
Init_colInspectorsEvent
End Sub
Private Sub Init_colInspectorsEvent()
'Initialize the inspectors events handler
Set colInspectors = Outlook.Inspectors
End Sub
Private Sub colInspectors_NewInspector(ByVal NewInspector As Inspector)
If NewInspector.CurrentItem.Class = olMail Then MsgBox "New mail inspector is opened"
If NewInspector.CurrentItem.Class = olTask Then MsgBox "New Task inspector is opened"
If NewInspector.CurrentItem.Class = olContact Then MsgBox "New Contact inspector is opened"
Set objInspector = NewInspector
End Sub
Private Sub objInspector_Close()
If objInspector.CurrentItem.Class = olMail Then 'MsgBox "Mail inspector is closing"
objInspector.CurrentItem.ShowCategoriesDialog
objInspector.CommandBars.ExecuteMso ("AddReminder") 'No error but not work
objInspector.CurrentItem.Save
End If
End Sub
【问题讨论】:
-
为什么需要在inspector窗口关闭后立即显示一个对话窗口?
-
@Eugene Astafiev 这是一个聪明的问题。因为我想强迫自己在工作流程中考虑邮件项目的优先级。我有一个习惯,我想打开收件箱的邮件,但我不一定有时间立即处理,所以我需要给自己一个提醒或跟进标记收到的邮件,如果需要。