![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
Please indulge me in a naive question. I'm new to this and only vaguely
familiar with the Outlook object model. I want my VBA code to execute /after/ the user clicks the "Send" button on each individual email and /before/ the email is actually sent. Depending on the content of the message, my VBA code will do something. So it's kind of like the built-in spell-checker. Where should I look to start traching myself how to do this? Thanks, Kyle |
#2
|
|||
|
|||
![]()
Use the Application.ItemSend event, e.g. :
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 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 "Kyle Ferrio" wrote in message ... Please indulge me in a naive question. I'm new to this and only vaguely familiar with the Outlook object model. I want my VBA code to execute /after/ the user clicks the "Send" button on each individual email and /before/ the email is actually sent. Depending on the content of the message, my VBA code will do something. So it's kind of like the built-in spell-checker. Where should I look to start traching myself how to do this? Thanks, Kyle |
#3
|
|||
|
|||
![]() Ms. Mosher: This is spot-on. I suppose this is all in your book, which I should probably pick up in my next book-order. Thanks! Kyle Sue Mosher [MVP-Outlook] wrote: Use the Application.ItemSend event, e.g. : 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 And for VBA basics, see http://www.outlookcode.com/d/vbabasics.htm |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How can I implement a "Send Without Save" button | Midwest Muskie | Outlook - Installation | 2 | April 24th 06 10:53 PM |
Allow "Contacts" button on the "Forward To" function in Outlook | microwave | Outlook - Using Contacts | 1 | April 20th 06 04:31 PM |
how to add a custom button on the explorer "standard" commandbar | Herve cadieu | Outlook and VBA | 1 | March 17th 06 04:33 PM |
adding a "print this slide" action button to powerpoint presentat | ixratee | Outlook - Using Forms | 0 | February 6th 06 11:14 PM |
Outlook Default "Out of Office" button for scheduling in Calendar | Blankblank | Outlook - Calandaring | 0 | January 9th 06 08:06 PM |