从其他软件通过 MAPI 发送电子邮件时执行 Outlook VBA

Execute Outlook VBA when sending email via MAPI from another software

我在 ThisOulookSession 中使用以下 VBA 代码在发送电子邮件时添加 BCC 地址:

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
    Dim objMe As Recipient
    Set objMe = Item.Recipients.Add("some@address.dot")
    objMe.Type = olBCC
    objMe.Resolve
    Set objMe = Nothing
End Sub

从 Outlook 本身发送时效果很好。但是当我使用 MAPI 通过我的 CRM 程序发送电子邮件时,VBA 没有被执行。所以我认为使用 MAPI 发送电子邮件不会考虑 ThisOutlookSession

有没有办法通过 Outlook 本身和 MAPI 执行我的 VBA 宏?

Application.ItemSend 当通过简单 MAPI 或 mailto link 发送邮件时,事件不会触发。这是设计使然。