Thursday, June 29, 2006

My constant email faux paus

Well, I keep sending my emails to the wrong people, using my work Outlook account. This has happened three times. I called one of my good friends "baby", I told some guy from another company that I loved him. So, I was determined that this would not happen again. I looked all around Outlook and Mozilla Thunderbird that would ask for a confirmation after I press "Send" to essentially ask me "do you really want to send your email to so-and-so", just so I am less likely to continue embarrassing myself. Apparently, I cannot be trusted with email without some safety switch.

As it turns out, I have found no built in features. But there is some VBA code coupled with Outlook. VBA is called Visual Basic for Applications, and it is a feature that is coupled with MS Office applications that allows you to customize certain things. The most apparent features are in Excel, where you can create your own formulates, in addition to sum(), average(), etc...

For Outlook, you can create a message box that pops up when you try to send an email. I found the original code here.

Mine is slightly adapted, so that it will ask you if you really want to send the message, then it lists the names of the people your email is going to.



Here is my adapted code:
-------------------------------------------------------------------------------------
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim prompt As String
prompt = "Are you sure you want to send message to:"


Dim Count As Integer
For Count = 1 To Item.Recipients.Count
prompt = prompt & Chr(13) & Item.Recipients(Count)
Next Count
prompt = prompt & "?"
If MsgBox(prompt, vbYesNo + vbQuestion + vbMsgBoxSetForeground + vbDefaultButton2, _
"Sample") = vbNo Then
Cancel = True
End If
End Sub

-------------------------------------------------------------------------------------
Okay, the question is, how do you actually use this. In Outlook, and it will only work in Outlook, go to Tools...Macro...Visual Basic Editor, and you should get a screen like this, but without the code. Make sure you click on "ThisOutLookSession" as in the picture. Copy the code in the blockquotes, and save it.

By default, Outlook has a high macro security, so you will have to go to Tools...Macro...Security to play around with your settings. For right now, I lowered my settings, before finding a better fix. You may have to restart Outlook.

2 comments:

Josh said...

I'm glad you clarified. I was about to take you off of my VIP List after you mentioned wanting to get into my pants... You sick, hatemongering, evil Libertarian/Conservative. Lol!

Josh said...
This comment has been removed by a blog administrator.