BCC based upon TO address

  • Thread starter Thread starter Damon Longworth
  • Start date Start date
Status
Not open for further replies.
D

Damon Longworth

Hello

I am trying to set add an address to the BCC field when a message is sent to

specific address. I have found some code to get the BCC, but do not know how

to find the address in the TO field.

How can I get the TO address into a string?

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)

Dim objRec As Recipient

Set objRec = Item.Recipients.Add("MyAddress@domain.com")

objRec.Type = olBCC

objRec.Resolve

Set objRec = Nothing

End Sub
 
Loop through the Recipients collection and check the Type property, it

will be olTo for anyone in the To field.

--JP

On Jan 29, 10:43 am, Damon Longworth

<DamonLongwo...> wrote:
> Hello

> I am trying to set add an address to the BCC field when a message is sentto
> specific address. I have found some code to get the BCC, but do not know how
> to find the address in the TO field.

> How can I get the TO address into a string?

> Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
>     Dim objRec As Recipient
>     Set objRec = Item.Recipients.Add("MyAddr...@domain.com")
>     objRec.Type = olBCC
>     objRec.Resolve
>     Set objRec = Nothing
> End Sub
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
B BCC issues after changing root folder path for gmail Using Outlook 1
M CC AND BCC Using Outlook 1
C Create new Message with shared contacts & BCC'ing recipients Outlook VBA and Custom Forms 0
N Outlook rules don't create a copy for bcc'ed emails Using Outlook 3
M Forward Appointment as BCC with VBScript Outlook VBA and Custom Forms 7
O Outlook on Android - add BCC Using Outlook 2
S Example VBA Macro - To Conditionally Change the From Account and Add a BCC Address on Emails Outlook VBA and Custom Forms 11
G Bcc help - Preventing multiple forwards from a bcc'd distribution group Using Outlook 1
J Will BCC messages still deliver if TO address fails Outlook 2013 Using Outlook 3
V Please help if you can. Problems with Bcc BCM (Business Contact Manager) 3
S BCC lists addressees Using Outlook 2
T bcc and Google imap Using Outlook 3
V Mark BCC when emails is sent from specific account Outlook VBA and Custom Forms 2
B Auto BCC VBA macro: how to add exceptions? Using Outlook 28
V using Bcc in Outlook.com 2013 Using Outlook 1
J Cc and Bcc not working Using Outlook 8
K received bcc as encrypted Using Outlook 12
V Contact group: addresses in BCC? Using Outlook 2
C a BCC script question Using Outlook 1
C BCC - How many email address will it accomodate? Using Outlook 2
P help me plase !!! outlook 2007 I can see mail Bcc Using Outlook 1
N How do you BCC Someone Using Outlook 1
S Automatically move recipients to BCC field Using Outlook 3
S Rule to Auto-forward/re-direct a specific incoming email to a group via BCC? Using Outlook 1
M Automatic Bcc Using Outlook 2
L automating a BCC on every email Using Outlook 1
M Create Rule to BCC email? Using Outlook 2
H show bcc field when viewing a sent message Using Outlook 15
williamlambton Customised To, CC, BCC and Have-replies-sent-to columns in message lists. Using Outlook 16
L Creating Custom Rule to Forward emails to a BCC Using Outlook 1
T display bcc field in sent emails Using Outlook 1
S Rule to move BCC email to a folder Using Outlook 6
A How to disable bcc option in GAL - Address Book - Exchange 2007 Exchange Server Administration 4
G All contacts from Contact Folder to BCC by code Outlook VBA and Custom Forms 1
G Populate BCC field with all Contacts within a Contact Folder Outlook VBA and Custom Forms 4
S BCC How to? Outlook VBA and Custom Forms 1
R (Outlook2003)Monitor change for "to" "cc" "bcc" on message compose dialog? Outlook VBA and Custom Forms 6
R suppress BCC Outlook VBA and Custom Forms 1
R how to display Bcc if not available? Outlook VBA and Custom Forms 1
P To: or CC: or BCC: Outlook VBA and Custom Forms 4
Y bcc macro Outlook VBA and Custom Forms 1
M Outlook 365 macro - automatically attach file based on subject line Outlook VBA and Custom Forms 0
sjbtax Update Task Custom Field based upon Task Overdue Status Outlook VBA and Custom Forms 8
J Action based on number of emails after sort by from Using Outlook 3
P How to clear out all contacts in iCloud, so I can use iCloud-based sync program Using Outlook 1
R Advise on using multiple instances of network files based on customers Outlook VBA and Custom Forms 8
whizzard Change FROM address based on TO or CC address Outlook VBA and Custom Forms 8
D Forwarding email based on the attachment file type and specific text found on the attachment file name Outlook VBA and Custom Forms 1
W Macro to Filter Based on Latest Email Outlook VBA and Custom Forms 6
A Macro to file emails into subfolder based on subject line Outlook VBA and Custom Forms 1

Similar threads

Back
Top