无法在Outlook 2016中修改截获的回复事件的主体

时间:2016-10-02 20:46:40

标签: vba outlook outlook-vba

我正在创建一个宏,只要用户点击"回复"按钮回复电子邮件,拦截回复事件并修改回复的BCC /主题/正文。

正在修改BCC和主题,但身体不想改变。

这是我正在使用的宏:

Private WithEvents oExpl As Explorer
Private WithEvents oItem As mailItem
Private bDiscardEvents As Boolean

Private Sub Application_Startup()
  Set oExpl = Application.ActiveExplorer
  bDiscardEvents = False
End Sub

Private Sub oExpl_SelectionChange()
  On Error Resume Next
  Set oItem = oExpl.Selection.Item(1)
End Sub

Private Sub oItem_Reply(ByVal Response As Object, Cancel As Boolean)
    Dim responseItem As mailItem
    Set responseItem = Response

    ' Both work fine
    responseItem.BCC = "example@example.com"
    responseItem.Subject = "this is reply subject"

    ' None of them works
    responseItem.HTMLBody = "this is reply html body"
    responseItem.Body = "this is reply text body"
End Sub

1 个答案:

答案 0 :(得分:0)

在您可以编辑之前显示它......

实施例

    ' None of them works
'    responseItem.HTMLBody = "this is reply html body"
    responseItem.display
    responseItem.body = "this is reply text body" & responseItem.body