Add BCC to email with VBA in Outlook 2013

后端 未结 2 1379
悲&欢浪女
悲&欢浪女 2020-12-19 02:41

I can\'t figure out the correct VBA code for Outlook 2013 to add a fixed email address to the BCC field of an email while it is open for editing. I have the following code,

相关标签:
2条回答
  • 2020-12-19 03:13

    You need to define Item:

    Sub Bcc()
    Dim objApp As Outlook.Application
    Set objApp = Application
    Dim objRecip As Recipient
    Dim Item As MailItem
    Set Item = objApp.ActiveInspector.CurrentItem
    With objMsg
    Set objRecip = Item.Recipients.Add("XXX@example.com")
    objRecip.Type = olBCC
    objRecip.Resolve
    End With
    End Sub
    
    0 讨论(0)
  • 2020-12-19 03:37

    Instead of Application.CreateItem(olMailItem), use Application.ActiveInspector.CurrentItem. If you set the BCC property, you will wipe out all existing BCC recipients. Use Recipients.Add (you have it commented out above) for each email address.

    0 讨论(0)
提交回复
热议问题