将“CC收件人”添加到Outlook 2010 VBA

时间:2015-03-06 17:50:01

标签: outlook outlook-vba

有人可以告诉我如何添加" Cc收件人"这段代码? "收件人"并编码所有工作按预期。谢谢你的时间。

Sub ForwardEmail(item As Outlook.MailItem)
' Dim oExplorer As Outlook.Explorer
Dim oMail As MailItem
' Set oExplorer = Application.ActiveExplorer

On Error GoTo Release

' If oExplorer.Selection.item(1).Class = olMail Then

Set oMail = item.Forward
oMail.Subject = oMail.Subject
oMail.HTMLBody = "Have a nice day." & vbCrLf & oMail.HTMLBody
oMail.Recipients.Add "email address here"

' oMail.Save
oMail.Send

' End If

Release:
Set oMail = Nothing
' Set oExplorer = Nothing
End Sub

1 个答案:

答案 0 :(得分:7)

set oRecip = oMail.Recipients.Add("email address here")
oRecip.Type = olCC

oMail.CC = "email address here"