Removing Recipients from an automatic response

Status
Not open for further replies.
Outlook version
Outlook 2013 32 bit
Email Account
Exchange Server
Greetings,
I have been working on an issue for the past few days (I am not a programmer by any means) and have cobbled together the following from several different places. What I am trying to do is create the macro where it creates an email based off of a template, includes the original, addresses it to ONLY the original recipient, and delay send for to days. So far everything works except for the recipient part. I cant figure out how to have it ONLY go to the original recipient, and not those on the BCC. Any help would be great, thank you!
Sub SendNew()
Debug.Print ("Starting SendNew")
Dim recip As Outlook.Recipient

For Each SelectedItem In ActiveExplorer.Selection
If SelectedItem.Class = OlObjectClass.olMail Then
Debug.Print ("Loop found Mail Item " + TypeName(SelectedItem))
Dim item As MailItem
Set item = SelectedItem

Dim newMsg As MailItem
Set newMsg = Application.CreateItemFromTemplate("C:\Users\me\Documents\Outlook Files\TestTemplate.oft")

newMsg.HTMLBody = newMsg.HTMLBody + item.HTMLBody

For Each recip In item.Recipients

If Not recip = "xxx@domain.com" + "yyy@domain.com" Then
newMsg.Recipients.Add recip

End If

Next recip

newMsg.DeferredDeliveryTime = DateAdd("w", 2, Now)

newMsg.Display

End If
Next SelectedItem
End Sub
 
You can filter the recipients by type

Code:
        For Each recip In item.Recipients

            If Not recip.Type = olBCC Then

                If Not recip = "xxx@domain.com" + "yyy@domain.com" Then

                    newMsg.Recipients.Add recip

                End If              

            End If

        Next recip
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
D Question on removing an alias Using Outlook 1
G Removing old emails when adding accounts Using Outlook 3
C Outlook 2007 Removing then adding account restores junk email processing Using Outlook 0
R Outlook is NOT removing attachments. Using Outlook 4
M Help sending email but removing signature via VBA Outlook VBA and Custom Forms 5
O How to paste website content using a specific font and removing URLs Using Outlook 2
M VBA Rule for removing all body but hyperlink then forwarding Outlook VBA and Custom Forms 9
N Recurring invite sent w/distribution list adding/removing attendees Using Outlook 0
A Removing illegal characters Outlook VBA and Custom Forms 2
D 'removing' an e-mail folder Using Outlook 2
G Wrong display name in from column when removing pf replication Exchange Server Administration 1
S Removing an Exchange Server account, retaining POP accounts Exchange Server Administration 1
D Removing Pop3 accounts on mulitple computers Using Outlook 3
K Removing outlines from outlook calendar Using Outlook 1
L Outlook 2007 - How to remove account without removing mail folders? Using Outlook 4
R What to backup before removing Outlook 2010? Using Outlook 4
V Outlook problem after removing avast Using Outlook 1
P Removing expired e-mail addresses Using Outlook 2
D Removing multiple Exchange 2007 servers on the same Domain and site Exchange Server Administration 1
S Removing myself as delegate from someone else's calendar Using Outlook 1
T Removing time zone setting from an appointment / meeting: is it possible? Using Outlook 2
C removing "Microsoft "End-User License Agreement" window BCM (Business Contact Manager) 1
S Removing "Research" menu item Outlook VBA and Custom Forms 1
H removing attachments... Outlook VBA and Custom Forms 1
M USING INITIALS AS RECIPIENTS Using Outlook 1
J Outlook Autocomplete (Recipients) opens upward Using Outlook 2
M Outlook 2016 IOS recipients receive my paragraph double space as quadruple space Using Outlook 2
S Macro to extract email addresses of recipients in current drafted email and put into clipboard Outlook VBA and Custom Forms 2
R Disable conversation thread from replying of recipients in the same subject. Please help Using Outlook 0
N Macro to move all recipients to CC while replying Outlook VBA and Custom Forms 0
C Create new Message with shared contacts & BCC'ing recipients Outlook VBA and Custom Forms 0
C Macro to add multiple recipients to message Outlook VBA and Custom Forms 3
Q Undisclosed recipients does not include sender Using Outlook 1
S What is /O=FIRST ORGANIZATION/OU=EXCHANGE ADMINISTRATIVE GROUP(***************)/CN=RECIPIENTS/CN=... Using Outlook 5
V Safe Recipients list Using Outlook 0
Diane Poremsky Foward a Message and CC the Original Recipients Using Outlook 0
Z Item.Recipients for Task Assignment on Send Outlook VBA and Custom Forms 10
Y Creating custom appointment request form with multiple mail recipients Outlook VBA and Custom Forms 5
B Print list of previously sent recipients Using Outlook 1
daveTQM Add email recipients to contacts Using Outlook 1
M Charter ISP Claims Outlook Generating STMP Errors of Too Many Recipients Using Outlook 1
D Meeting Request - Too Many Recipients Using Outlook 0
T Problem with .Recipients.Add("alias") Outlook VBA and Custom Forms 3
Fozzie Bear Change the Display Name recipients see for Exchange account Exchange Server Administration 0
D Delay Delivery: Visible to recipients? Using Outlook 1
P Your message did not reach some or all of the intended recipients. Using Outlook 2
L recipients are not recieving my outgoing emails Using Outlook 1
C Your message did not reach some or all of the intended recipients. Using Outlook 2
T Outlook 2013 Duplicate Recipients Using Outlook 9
E msg attachments lose their recipients "smtp" address Using Outlook 2

Similar threads

Back
Top