Add BCC um E-Mail mit VBA in Outlook 2013

Ich kann nicht herausfinden, den richtigen VBA-code für Outlook 2013 hinzufügen, um eine Feste E-Mail-Adresse ins BCC-Feld einer E-Mail ein, während es zum Bearbeiten zu öffnen. Ich habe den folgenden code erstellt die E-Mail und legt dann das "BCC".

Möchte ich hinzufügen, BCC, E-Mails, die ich zu beantworten, so wird die Nachricht bereits im "Entwurf" form.

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 = "[email protected]; [email protected]"

    .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

* Update *

Implementiert habe ich den großen Rat von Dmitri

Mein code lautet nun:

Sub BCC()
Dim objRecip As Recipient
Set oMsg = Application.ActiveInspector.CurrentItem

With oMsg

Set objRecip = item.Recipients.add("[email protected]")
objRecip.Type = olBCC
objRecip.Resolve

End With

Set oMsg = Nothing

End sub

Jedoch wenn ich ihn starten will bekomme ich eine Fehlermeldung "Laufzeitfehler '424' - Objekt erforderlich" und er hebt die Zeile:

Set objRecip = item.Recipients.Add("[email protected]")
Schreibe einen Kommentar