Prompt sender for cc

I've done some research and I've found several thrid party software add-ons for Outlook that do auto cc/bcc. Some even allow it to be determine by rules (based on email address or subject contents, for example). The problem we have is that there are too many variables to define a realistic set of rules. For example, we have inside sales support members that deal with 2 or more sales reps. Any email correspondonce (new or replies) with a sales rep's client must be cc:ed to that rep. However, non-client related email or email to clients that don't have an assigned rep, don't need to be cc:ed to anyone.

What would be the best solution for us is if when inside support person generates (or replies to) an email that a prompt comes up to select a person to cc but have the ability to send the message whether or not they have entered/selected someone to carbon copy. I would be will to entertain any solution as long as end users can work directly from Outlook.

Thanks in advance for thought-provoking advice, recommendations or comments.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David LeeCommented:
Hi djinIT,

You can do this via code by trapping the Application_ItemSend event.  This occurs every time an item is sent.  You'd need to first determine if it's a mail item, and then somehow determine if it's from an inside support person.  If yes to both, then display a dialog-box asking if they want to CC the message to someone.  If they enter an address, then add it to the CC line.  If not, then allow the send to continue.

djinITAuthor Commented:
Hi BDF -

If this is code that can be applied on a per client basis then I would then only need to determine if its mail. How difficult is this to do? Or better question how exactly do I get started?
David LeeCommented:

Here's the solution I described.  Follow these instructions to use it.  

1.  Start Outlook
2.  Click Tools->Macro->Visual Basic Editor
3.  If not already expanded, expand Microsoft Office Outlook Objects and click on ThisOutlookSession
4.  Copy the code and paste it into the right-hand pane of the VB Editor window
5.  Click the diskette icon on the toolbar to save the changes
6.  Close the VB Editor
7.  Click Tools->Macro->Security
8.  Set the Security Level to Medium
9.  Close Outlook
10.  Start Outlook
11.  Outlook will display a dialog-box warning that ThisOutlookSession contains macros and asking if you want to allow them to run.  Say yes.

This solution checks all outgoing items.  If an item is an email message and is from an inside sales rep, then it pops up a dialog-box asking them if they need to copy a sales rep.  At the moment I am forcing all messages to meet the inside sales rep test because I don't know how you want to go about determining that.  The user enters or does not enter an address or addresses.  Those addresses are then added to the message and the message is sent.  If they don't enter any address, then the message goes as is.

You asked in your last post if this code "can be applied on a per client basis".  The answer is that it depends on what you have in mind.  If you mean that you'd like it to checnk who the message is going to and act accordingly, then the answer is yes, but with a caveat.  Reading an address field from code will trigger Outlook's built in security.  This will cause a security warning dialog-box to pop up warning that an application is accessing your mailbox and asking if you want to allow it to continue.  You have to click the Yes button for the code to continue.  There are three ways around this  One, write the code as an Outlook add-in.  Add-ins have different security rules, but they are also more difficult to write.  Two, use Click-Yes (  This utility sits in the system tray and watches for that security dialog-box.  When it appears, it clicks the Yes button for you.  Three, use Outlook Redemption (  This component library safely circumvents Outlook security, allowing the code to do its job.  If you want to use either of the last two, then I can modify the code to check who the message is addressed to and take action based on the result.

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
    Const IsInsideSalesRep = True
    Dim strAddresses As String
    If Item.Class = olMail Then
        If IsInsideSalesRep Then
            strAddresses = InputBox("If this message is to a client, then enter the email address of the client's sales rep." & vbCrLf & "If there are mutliple addressees, then separate them with a a semicolon (;)", "Address to Sales Rep")
            If strAddresses <> "" Then
                If Item.CC = "" Then
                    Item.CC = strAddresses
                    Item.CC = Item.CC & ";" & strAddresses
                End If
            End If
        End If
    End If
End Sub
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

djinITAuthor Commented:
Thanks BDF. I'll look into the workarounds #2 and #3 to see what will work best for us. Further, I'll try out the code this afternoon and get back to you tomorrow. Thanks much for your efforst thus far.

djinITAuthor Commented:
At startup I did get the message about enabling macros. Answered to the affirmative. Wrote and replied various test emails but I don't get prompted to enter anything. Messages are sent as normal.

And to clarify, I do want this script to generate the popup dialog box when sending any email message (new or replied).
David LeeCommented:
For some reason Outlook sometimes doesn't run macros even after enabling them.  Typically the cure for that is to explicitly run a macro.  Afterwards, Outlook appears to recognize that macros are enabled.  Add the macro below to Module1, then run it by clicking Tools->Macro->Macros, selecting this macro, and clicking Run.  All it does is create a blank message and display it onscreen.  When the message appears you can simply close it.  Then try sending something again and let me know what happens.

Sub ForceMacros()
    Dim olkItem As Outlook.MailItem
    Set olkItem = Application.CreateItem(olMailItem)
    Set olkItem = Nothing
End Sub

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
djinITAuthor Commented:
I exported and then deleted all my modules so I could start fresh. That did the trick. So I'm assigning you points and an "A". I do have a couple of inquiries.

When I hit "send" at first I thought Oultook froze because the dialog box didn't pop up. I then realized the box is indeed popping up but its hidden behind the email message. Is there a way to control that and make sure its always on top? And lastly, the addresses that sender would cc to are all in our global address list. I know I'm being really picky but is it possible to have display the address list? Or maybe even have a couple default addresses display and the user can simply delete one or both address from the popup?
David LeeCommented:
I'll check into possible ways to ensure the dialog-box appears as the foremost window.  Displaying the address list is possible, but it'd require more complicated code and possibly the creation of a user form..  
djinITAuthor Commented:
Sounds good BDF. If its easier to code two default addresses then that would definitely suffice. User could simply delete one or both. Thanks!
David LeeCommented:
I don't know of a way to make the dialog-box the topmost window in Outlook.  Adding mutliple addresses to the dialog-box is simple though.  Simply replace the line with the InputBox command with the one below.

    strAddresses = InputBox("If this message is to a client, then enter the email address of the client's sales rep." & vbCrLf & "If there are mutliple addressees, then separate them with a a semicolon (;)", "Address to Sales Rep", ";")
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.