我无法确定Outlook 2013的正确VBA代码,以便在电子邮件打开进行编辑时将固定电子邮件地址添加到电子邮件的BCC字段.我有以下代码,它创建电子邮件,然后设置BCC.
我想将BCC添加到我要回复的电子邮件中,因此该消息已经是"草稿"形式.
Sub sendcomment_click()
Set oMsg = Application.CreateItem(olMailItem)
With oMsg
.Recipients.Add ("email address")
'Set objRecip = Item.Recipients.Add("email address")
'objRecip.Type = olBCC
'objRecip.Resolve
' Join Email addresses by "; " into ".BCC" as string
.BCC = "Person.A@somewhere.com; Person.B@somewhere.com"
.Subject = "New Comment by"
.Body = "sdfsdfsdf"
.Display ' Comment this to have it not show up
'.Send ' Uncomment this to have it sent automatically
End With
Set oMsg = Nothing
End Sub
Run Code Online (Sandbox Code Playgroud)
*更新*
我实施了德米特里的伟大建议
我的代码现在写道:
Sub BCC()
Dim objRecip …Run Code Online (Sandbox Code Playgroud)