如何将抄送添加到当前宏以带附件的回复

时间:2018-10-18 08:41:27

标签: vba outlook

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

我试图从herehere合并它,但我不是专业人士,收到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

1 个答案:

答案 0 :(得分:0)

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

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