A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Stopping email from being sent with blank subject



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old April 21st 07, 01:12 AM posted to microsoft.public.outlook.program_vba
sfleck
external usenet poster
 
Posts: 5
Default Stopping email from being sent with blank subject

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  
Old April 21st 07, 06:44 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Stopping email from being sent with blank subject



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  
Old April 25th 07, 07:19 AM posted to microsoft.public.outlook.program_vba
Michael Bednarek
external usenet poster
 
Posts: 6
Default Stopping email from being sent with blank subject

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  
Old April 25th 07, 10:42 PM posted to microsoft.public.outlook.program_vba
sfleck
external usenet poster
 
Posts: 5
Default Stopping email from being sent with blank subject


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  
Old April 26th 07, 06:59 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Stopping email from being sent with blank subject



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
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
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


All times are GMT +1. The time now is 12:57 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.