Consulting

Results 1 to 3 of 3

Thread: Add a list of people to the bcc field

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Master paulked's Avatar
    Joined
    Apr 2006
    Posts
    1,007
    Location

    Add a list of people to the bcc field

    Hi there

    I would like to copy certain emails to colleagues without the main recipient seeing the email addresses.

    I've got this code:
    Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
        Dim objRecip As Recipient
        Dim strMsg As String
        Dim res As Integer
        Dim strBcc As String
        On Error Resume Next
        res = MsgBox("Do you want to add Fringe BCC's?", vbYesNo, "Add Fringe contacts to BCC?")
        If res = vbNo Then Exit Sub
        strBcc = "xxxxxxxxx@icloud.com"
        Set objRecip = Item.Recipients.Add(strBcc)
        objRecip.Type = olBCC
        If Not objRecip.Resolve Then
            strMsg = "Could not resolve the Bcc recipient. " & _
            "Do you want still to send the message?"
            res = MsgBox(strMsg, vbYesNo + vbDefaultButton1, _
            "Could Not Resolve Bcc Recipient")
            If res = vbNo Then
                Cancel = True
            End If
        End If
        Set objRecip = Nothing
    End Sub
    which will add one email address but I'd like to add many addresses.

    Any pointers/advice much appreciated.

    Best regards

    Paul Ked
    Last edited by paulked; 04-09-2019 at 10:54 AM.
    Semper in excretia sumus; solum profundum variat.

  2. #2
    The simplest solution is to create a Contact Group in Outlook that contains the addresses you want to add, then set strBCC to the name of the contact group.
    Graham Mayor - MS MVP (Word) 2002-2019
    Visit my web site for more programming tips and ready made processes
    http://www.gmayor.com

  3. #3
    VBAX Master paulked's Avatar
    Joined
    Apr 2006
    Posts
    1,007
    Location
    Thanks for that, I obviously couldn't see the wood for the trees!
    Semper in excretia sumus; solum profundum variat.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •