![]() |
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
|
|||
|
|||
![]()
I have this Code that does not seem to work in OL2003 when placeing in
ThisOutlookSession Private Sub Application_ItemForgot(ByVal Item As Object, Cancel As Boolean) If Item.Subject = "" Then MsgBox "Forgot Subject" Cancel = True End If End Sub This a code modified from sue. I use word as my editor if that matters End Sub |
Ads |
#2
|
|||
|
|||
![]() Funny modification, Outlook doesn't know an 'ItemForgot' event ![]() The event is called ItemSend, that name cannot be changed. If you want to have a procedure with that name (which is really useful if your code gets more and more) then do it like this: Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) ItemForgot Item, Cancel End Sub Private Sub ItemForgot(ByVal Item As Object, Cancel As Boolean) If Item.Subject = "" Then MsgBox "Forgot Subject" Cancel = True End If End Sub -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook Quick-Cats - Categorize Outlook data: http://www.vboffice.net/product.html...&lang=en&pub=6 Am Fri, 20 Apr 2007 16:12:01 -0700 schrieb sfleck: I have this Code that does not seem to work in OL2003 when placeing in ThisOutlookSession Private Sub Application_ItemForgot(ByVal Item As Object, Cancel As Boolean) If Item.Subject = "" Then MsgBox "Forgot Subject" Cancel = True End If End Sub This a code modified from sue. I use word as my editor if that matters End Sub |
#3
|
|||
|
|||
![]()
On Fri, 20 Apr 2007 16:12:01 -0700, sfleck wrote in microsoft.public.outlook.program_vba:
I have this Code that does not seem to work in OL2003 when placeing in ThisOutlookSession Private Sub Application_ItemForgot(ByVal Item As Object, Cancel As Boolean) If Item.Subject = "" Then MsgBox "Forgot Subject" Cancel = True End If End Sub This a code modified from sue. I use word as my editor if that matters As Michael Bauer already pointed out, there's no such event as _ItemForgot, and consequently that procedure will never be called. Here's my variation that theme (3 lines): Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) If Item.Class = olMail Then If Item.Subject = "" Then If MsgBox("Empty ""Subject:"" line. Send item?", vbYesNo + vbQuestion, "MB SendMail") vbYes Then Cancel = True End Sub -- Michael Bednarek http://mbednarek.com/ "POST NO BILLS" |
#4
|
|||
|
|||
![]() So if I have another Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) then I addit into this way? "Michael Bauer [MVP - Outlook]" wrote: Funny modification, Outlook doesn't know an 'ItemForgot' event ![]() The event is called ItemSend, that name cannot be changed. If you want to have a procedure with that name (which is really useful if your code gets more and more) then do it like this: Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) ItemForgot Item, Cancel End Sub Private Sub ItemForgot(ByVal Item As Object, Cancel As Boolean) If Item.Subject = "" Then MsgBox "Forgot Subject" Cancel = True End If End Sub -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook Quick-Cats - Categorize Outlook data: http://www.vboffice.net/product.html...&lang=en&pub=6 Am Fri, 20 Apr 2007 16:12:01 -0700 schrieb sfleck: I have this Code that does not seem to work in OL2003 when placeing in ThisOutlookSession Private Sub Application_ItemForgot(ByVal Item As Object, Cancel As Boolean) If Item.Subject = "" Then MsgBox "Forgot Subject" Cancel = True End If End Sub This a code modified from sue. I use word as my editor if that matters End Sub |
#5
|
|||
|
|||
![]() You can only have one Application_ItemSend procedure. If you want to call different functions from that then yes, add whatever you like. -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook Quick-Cats - Categorize Outlook data: http://www.vboffice.net/product.html?id=2006063&cmd=detail&lang=en&pub=6 Am Wed, 25 Apr 2007 13:42:01 -0700 schrieb sfleck: So if I have another Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) then I addit into this way? "Michael Bauer [MVP - Outlook]" wrote: Funny modification, Outlook doesn't know an 'ItemForgot' event ![]() The event is called ItemSend, that name cannot be changed. If you want to have a procedure with that name (which is really useful if your code gets more and more) then do it like this: Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) ItemForgot Item, Cancel End Sub Private Sub ItemForgot(ByVal Item As Object, Cancel As Boolean) If Item.Subject = "" Then MsgBox "Forgot Subject" Cancel = True End If End Sub -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook Quick-Cats - Categorize Outlook data: http://www.vboffice.net/product.html...&lang=en&pub=6 Am Fri, 20 Apr 2007 16:12:01 -0700 schrieb sfleck: I have this Code that does not seem to work in OL2003 when placeing in ThisOutlookSession Private Sub Application_ItemForgot(ByVal Item As Object, Cancel As Boolean) If Item.Subject = "" Then MsgBox "Forgot Subject" Cancel = True End If End Sub This a code modified from sue. I use word as my editor if that matters End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Blank Email Body and Subject | paloli | Outlook - General Queries | 1 | December 8th 06 03:12 PM |
blank contact stopping syncronization | Camilo Telles | Outlook - Using Contacts | 1 | August 31st 06 05:41 AM |
Blank subject notification | Ken B | Outlook - General Queries | 3 | August 8th 06 04:47 PM |
How to filter email with blank subject, to, and message body | ken4az | Outlook - Installation | 0 | January 20th 06 06:27 PM |
Blank from and subject | turboglide | Outlook Express | 2 | January 14th 06 01:22 AM |