gpt4 book ai didi

vba - 将 "CC recipient"添加到 Outlook 2010 VBA

转载 作者:行者123 更新时间:2023-12-02 16:28:49 26 4
gpt4 key购买 nike

有人可以告诉我如何向此代码添加“抄送收件人”吗? “致收件人”和代码均按预期工作。感谢您抽出时间。

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"

关于vba - 将 "CC recipient"添加到 Outlook 2010 VBA,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28904656/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com