【问题标题】:Cannot modify body of intercepted Reply event in Outlook 2016无法修改 Outlook 2016 中截获的回复事件的正文
【发布时间】:2020-06-23 08:42:53
【问题描述】:

我正在创建一个宏,当用户单击“回复”按钮回复电子邮件时,它会拦截回复事件并修改回复的密件抄送/主题/正文。

密件抄送和主题正在修改,但正文不想更改。

这是我正在使用的宏:

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

【问题讨论】:

    标签: vba outlook


    【解决方案1】:

    在编辑之前显示它...

    例子

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

    【讨论】:

    • 这对我有用。不知道为什么它没有被标记为答案!感谢您提供有用的回复和示例。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-01-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多