Solved

Macro to prompt to add a cc address

Posted on 2006-11-15
9
495 Views
Last Modified: 2008-02-01
Here is what I would like to have happen in our Outlook 2000:
When the user clicks "send", Outlook will see if the word "programming" exists in the subject line of the outbound email.  If it does, Outlook will prompt the user "Send a copy (CC:) to programming@abc.com".
If the user clicks "yes", Outlook will then drop that email address in the CC field and send the message.
If the user clicks "no", Outlook will just send the message.

Can that be automated?
If yes, does that need to be done through a macro, a rule or both?

Thanks!
0
Comment
Question by:snyperj
  • 5
  • 4
9 Comments
 

Author Comment

by:snyperj
ID: 17946395
An afterthought would be this:
If Outlook could first look at the CC: field to see if it the prompt is necessary- that would be a bigger homerun.
Some users are very good about entering the address as a CC: on their own.  Some arent.  :-)
0
 
LVL 35

Accepted Solution

by:
mvidas earned 500 total points
ID: 17947355
Hi,

You would have to do this using a macro.  Go to the macro editor (alt-f11), and in the ThisOutlookSession object, paste the following in (assuming you don't already have an _ItemSend event):

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
 If TypeName(Item) <> "MailItem" Then Exit Sub
 If InStr(1, Item.Subject, "programming", vbTextCompare) = 0 Then Exit Sub
 If InStr(1, Item.CC, "programming", vbTextCompare) > 0 Then Exit Sub
 Select Case MsgBox("Would you like to CC programming@abc.com?", vbYesNoCancel)
  Case vbCancel: Cancel = True
  Case vbYes: Item.CC = IIf(Len(Item.CC) > 0, Item.CC & "; ", "") & "programming@abc.com"
 End Select
End Sub

Matt
0
 

Author Comment

by:snyperj
ID: 17948152
Dang,  I was hoping there was someway around getting the "A program is trying to access email addresses you have stored in Outlook..." etc, etc.   by running the macro only if the CC field was blank, but not every time.

No option?

(We are unable to use redemption or ClickYes here due to company policy.)


0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 35

Expert Comment

by:mvidas
ID: 17948284
Are you able to install COM add-ins? There is one of those too that will do the same, and doesn't need to be started or anything. I can get the link if you can

But with later versions of outlook 2000, the security warning will pop up when the CC property gets accessed.  This is to prevent malicious code from reading the CC of a message, and sending spam out to any addresses in it.
0
 

Author Comment

by:snyperj
ID: 17948524
No - we priobably can't install those either (but do post the link please.)

Your explanation in the CC field makes sense I guess.  Bummer.

Thanks for the code.
0
 
LVL 35

Expert Comment

by:mvidas
ID: 17948587
The link for the addin is http://www.mapilab.com/outlook/security/
You may want to try it; the only way I could see your IT dept limiting it is just preventing you from downloading it.  Installing it can be done a couple ways (the easiest is Tools / Options / Other / Advanced Options / COM AddIns / Add)

Let me know if you need anything else!
Matt
0
 

Author Comment

by:snyperj
ID: 17948628
Thanks- I tried it.  I can download it OK, but because it is a setup.exe, when I run it I get pop-up login box to enter an administrator login which I of course don't have.
0
 
LVL 35

Expert Comment

by:mvidas
ID: 17948710
Hmm.. I have been vigilant in sticking with my outlook 2000 SR1 here at work, so I have no need for that addin, but I'll take a look at it later and see if it is just an executable archive or something.  If so (assuming no readme's exist preventing this, don't want to break any rules here) I'll see if I can post the .dll file itself for you.  I'm sure your IT dept would help if the need really existed; the addin doesnt do anything aside from make this routine a little more convenient.
I'll let you know if I have any luck with it
0
 

Author Comment

by:snyperj
ID: 17950535
Thanks.  It depends on who at IT here happens to get the request.  Some would help, some would stick to the book on policy.  No  uniformity- a whole different problem here.  Thanks for your help.
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
Many people use more than one email account and so it becomes difficult for them to manage them when they use separate accounts,  so, in this article, I have shared an easy way to add Other Mail Accounts in your Google Inbox. It helps to combine all…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

856 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