Link to home
Start Free TrialLog in
Avatar of RTM2007
RTM2007Flag for Afghanistan

asked on

Outlook Macro to BCC Specific Sent E-Mails to Party

So I know in Outlook you can set a macro to automatically BCC messages to someone else by using:

Public Sub MyMacro()
Dim Mail as Outlook.MailItem

Set Mail=Application.ActiveInspector.CurrentItem
Mail.BCC = "your address here"
End sub

But what I would like to know if it is possible to set condition. For example, so that only messages with specific words in the subject or that are sent to a specific recipient are BCC'd.
Avatar of RTM2007
RTM2007
Flag of Afghanistan image

ASKER

Also is it possible to have it not show up as it was sent to that BCC recipient in the Sent Items message?
Avatar of David Lee
Hi, RTM2007.

Yes, it's possible to have the BCC work off of a condition.  It's not possible to to hide the fact that the message was BCC'd in Sent Items.
Public Sub MyMacro()
    Dim Mail as Outlook.MailItem
    Set Mail=Application.ActiveInspector.CurrentItem
    If InStr(1, Mail.Subject, "Some word or phrase") Then
        Mail.BCC = "your address here"
    End If
End sub

Open in new window

Avatar of RTM2007

ASKER

Which command makes it not show up in the sent items?

Also how do you set the condition for if instr so that if it sent to someone.. For example if I only want e-mails that are sent to jmallow@contingentco1.com BCC'd?
ASKER CERTIFIED SOLUTION
Avatar of David Lee
David Lee
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of RTM2007

ASKER

Will it trigger security for Outlook 2007? How do I disable the security for 2003?
In regard to suppressing teh security warnings:

You can modify your code to use redemption:
    http://www.dimastr.com/redemption/ 
You can use an outlook add-in i.e:
    http://www.mapilab.com/outlook/security 
Or finally you can use clickyes
    http://www.contextmagic.com/

Chris
No, it will not trigger the security warning for Outlook 2007.  

Outlook security cannot be turned off or disabled,  Instead you have to work around it using one of the tools that Chris listed.