?
Solved

Outlook Macro to BCC Specific Sent E-Mails to Party

Posted on 2009-04-17
7
Medium Priority
?
537 Views
Last Modified: 2012-05-06
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.
0
Comment
Question by:RTM2007
  • 3
  • 3
7 Comments
 
LVL 2

Author Comment

by:RTM2007
ID: 24168883
Also is it possible to have it not show up as it was sent to that BCC recipient in the Sent Items message?
0
 
LVL 76

Expert Comment

by:David Lee
ID: 24169108
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

0
 
LVL 2

Author Comment

by:RTM2007
ID: 24169123
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?
0
Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

 
LVL 76

Accepted Solution

by:
David Lee earned 2000 total points
ID: 24169333
"Which command makes it not show up in the sent items?"
Do you mean you want the message to not show up in sent items at all?

"For example if I only want e-mails that are sent to jmallow@contingentco1.com BCC'd?"
The code below will do this.  If you are using Outlook 2003 or earlier, then this is going to trigger Outlook's built-in security.
Public Sub MyMacro()
    Dim Mail as Outlook.MailItem, olkRecipient as Outlook.Recipient
    Set Mail=Application.ActiveInspector.CurrentItem
    If InStr(1, Mail.Subject, "Some word or phrase") Then
        Mail.BCC = "your address here"
    End If
    For Each olkRecipient in Mail.Recipients
        If olkRecipient.Address = "jmallow@contingentco1.com" Then
            Mail.BCC = "your address here"
        End If
    Next
End sub

Open in new window

0
 
LVL 2

Author Comment

by:RTM2007
ID: 24170045
Will it trigger security for Outlook 2007? How do I disable the security for 2003?
0
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 24171925
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
0
 
LVL 76

Expert Comment

by:David Lee
ID: 24172198
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.
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will help to fix the below error for MS Exchange server 2010 I. Out Of office not working II. Certificate error "name on the security certificate is invalid or does not match the name of the site" III. Make Internal URLs and External…
Are you looking for the options available for exporting EDB files to PST? You may be confused as they are different in different Exchange versions. Here, I will discuss some options available.
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Suggested Courses

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question