添加“抄送收件人"到 Outlook 2010 VBA [英] Add a "CC recipient" to Outlook 2010 VBA
本文介绍了添加“抄送收件人"到 Outlook 2010 VBA的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人可以告诉我如何在此代码中添加抄送收件人"吗?收件人"和代码都按预期工作.感谢您抽出宝贵时间.
Can someone please show me how to add a "Cc recipient" to this code? The "To Recipient" and code all work as intended. Thank you for your time.
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
推荐答案
set oRecip = oMail.Recipients.Add("email address here")
oRecip.Type = olCC
或
oMail.CC = "email address here"
这篇关于添加“抄送收件人"到 Outlook 2010 VBA的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文