【问题标题】:How to add a CC to current macro for Reply with attachments如何将 CC 添加到当前宏以使用附件回复
【发布时间】:2018-10-18 17:16:09
【问题描述】:

我正在尝试修改我的宏,以便用附件回复所有内容,以便将我的老板的电子邮件也添加到抄送中,因为我必须经常这样做。

我试图从 here 或 here 合并它,但我不是专业人士并收到 424 错误:(

    Set objRecip = objMail.Recipients.Add("theboss@thecompany.com")
    oRecip.Type = olCC

能否请您帮忙修改当前宏以将电子邮件地址添加到 CC 中?

我当前的宏

Sub ReplyWithAttachments()
Dim oReply As Outlook.MailItem
Dim oItem As Object
Set oItem = GetCurrentItem()
If Not oItem Is Nothing Then
Set oReply = oItem.Reply
CopyAttachments oItem, oReply
oReply.Display
oItem.UnRead = False
End If
Set oReply = Nothing
Set oItem = Nothing
End Sub

Sub ReplyAllWithAttachments()
Dim oReply As Outlook.MailItem
Dim oItem As Object
Set oItem = GetCurrentItem()
If Not oItem Is Nothing Then
Set oReply = oItem.ReplyAll
CopyAttachments oItem, oReply
oReply.Display
oItem.UnRead = False
End If
Set oReply = Nothing
Set oItem = Nothing
End Sub

Function GetCurrentItem()
...
End Function

Sub CopyAttachments
...
End Sub

【问题讨论】:

  • 似乎每行都有错字。 oReply not objMail Set objRecip = oReply.Recipients.Add("theboss@thecompany.com") and objRecip not oRecip objRecip.Type = olCC

标签: vba outlook


【解决方案1】:

我认为最简单的方法是从原始电子邮件中提取抄送列表,然后将其附加到您的老板电子邮件中:

If Not oItem Is Nothing Then
    Set oReply = oItem.Reply
    oReply.CC = oItem.CC & ";theboss@thecompany.com"
    CopyAttachments
    oReply.Display
    oItem.UnRead = False
End If

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-06-23
    • 1970-01-01
    • 1970-01-01
    • 2021-11-21
    相关资源
    最近更新 更多