Item_Send事件未针对Outlook 2010 .oft模板触发

时间:2014-12-29 20:42:22

标签: vba outlook outlook-vba outlook-2010

我为一个Outlook邮件消息模板编写了一个非常简单的Item_Send处理程序,该模板存储为我通过宏运行的oft文件:

Function Item_Send()
    MsgBox "hello"
    Item_Send = False
End Function

此事件未触发:我看不到消息框,消息发送。

任何人都可以解释为什么会这样,以及我如何解决它?

1 个答案:

答案 0 :(得分:-1)

你可以在" ThisOutlookSession"中使用内置的ItemSend。像这样的模块。

Private Sub Application_ItemSend(ByVal Item As Object, _
                                  Cancel As Boolean) 
    If item.subject = "subject of the template" then
        MsgBox "hello"
        Cancel = True 
   End if
End Sub
相关问题