PDA

View Full Version : Please help, prompt msgbox when TO and or CC field NOT empty



atanatashi
04-01-2014, 04:23 AM
Hi,

How do i create a msgbox in outlook that prompts me before sending an email if the TO and or CC fields are NOT empty. i mostly send using the BCC field.. can anyone help?

Thank you.

acantor
04-01-2014, 11:55 AM
Sub CheckToAndCcFieldsAndSend()

' Add Reference to "Microsoft Forms 2.0 Object Library"
' If not available, find it by browsing to "c:\Windows\SysWOW64\FM20.DLL"

Set myItem = ActiveInspector.CurrentItem

If myItem.CC = "" And myItem.To = "" Then
MsgBox "OK"
myItem.Send

Else
MsgBox "Get rid of To and/or CC field!"
End If
End Sub