View Single Post
  #6  
Old June 2nd 06, 06:30 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Set Warnings Macro

Please provide exact steps that you followed.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Donbenz" wrote in message ...
Sue,

When i try to load the code into my macro the saved macro disappears. Maybe
I am not setting it up right. I think it has some thing to do with the
Private Sub verses just the Regular Sub.

Thank You

"Sue Mosher [MVP-Outlook]" wrote:

Sample code:

Private Sub Application_ItemSend _
(ByVal Item As Object, Cancel As Boolean)
Dim strMsg As String
Dim res As Long
If Item.Subject = "" Then
Cancel = True
strMsg = "Please fill in the subject before sending."
MsgBox strMsg, _
vbExclamation + vbSystemModal, "Missing Subject"
Item.Display
End If
End Sub

For a more elaborate version that also checks for expected attachments, see http://www.outlookcode.com/codedetail.aspx?id=553

And for VBA basics, see http://www.outlookcode.com/d/vbabasics.htm


--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Donbenz" wrote in message ...
Sue
I am not familiar with this could you explain in a little more detail.

"Sue Mosher [MVP-Outlook]" wrote:

Put code in the Application_ItemSend event handler in the built-in ThisOutlookSession module.


"Donbenz" wrote in message ...
I am trying to run a set warnings macro for everytime I send a message does
anyone have any Ideas how to set that up?

Donbenz


Ads