我想获取后续标志的对话框和 CategoriesDialog 以在关闭 mailitem.
我试图从这里修改代码。当我关闭邮件时,所有事情都保持正常,并得到类别对话框。我无法像这样获得后续标志的对话框。没有弹出错误消息。
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
Outlook 对象模型不提供用于显示Add Reminder...
对话框的任何属性或方法。
您能做的最好的事情是以编程方式执行内置控件:
CommandBars.ExecuteMso ("AddReminder")
但我不认为Close
事件处理程序是处理此类事情的正确位置。