PC Review


Reply
Thread Tools Rate Thread

How to check subject line and add spaces in it

 
 
=?Utf-8?B?UlM=?=
Guest
Posts: n/a
 
      29th Jun 2007
I have the code that checks for spaces in the subject line after a semicolon
and tells the user to check the subject line. How can I have outlook add a
space after each semicolon if its not there. Thanks...

Example of a subject line: test1;test2;test3;
Need it to be test1; test2; test3;

Private Sub Application_ItemSend _
(ByVal Item As Object, Cancel As Boolean)
Dim strMsg As String
Dim res As Long
If Item.Subject Like "*;[a-z]*" Then
Cancel = True
strMsg = "Please make sure there is a space after each semicolon."
MsgBox strMsg, _
vbExclamation + vbSystemModal, "Missing Subject"
Item.Display
End If
End Sub

 
Reply With Quote
 
 
 
 
F. H. Muffman
Guest
Posts: n/a
 
      29th Jun 2007
"RS" <(E-Mail Removed)> wrote in message
news:229674AF-98E3-4E24-91FC-(E-Mail Removed)...
>I have the code that checks for spaces in the subject line after a
>semicolon
> and tells the user to check the subject line. How can I have outlook add
> a
> space after each semicolon if its not there. Thanks...
>
> Example of a subject line: test1;test2;test3;
> Need it to be test1; test2; test3;
>
> Private Sub Application_ItemSend _
> (ByVal Item As Object, Cancel As Boolean)
> Dim strMsg As String
> Dim res As Long
> If Item.Subject Like "*;[a-z]*" Then
> Cancel = True
> strMsg = "Please make sure there is a space after each semicolon."
> MsgBox strMsg, _
> vbExclamation + vbSystemModal, "Missing Subject"
> Item.Display
> End If
> End Sub
>


Try:

Private Sub Application_ItemSend _
(ByVal Item As Object, Cancel As Boolean)
Dim strMsg As String
Dim res As Long
If Item.Subject Like "*;[a-z]*" Then
strMsg = Item.Subject
strFind = ";"
strReplace = "; "
Item.Subject = Replace(strMsg, strFind, strReplace)
End If
End Sub

--
f.h.

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to turn off spell check in Subject line Nelson Microsoft Outlook Discussion 1 22nd Jan 2009 07:43 PM
Outlook spell check should also check message subject line =?Utf-8?B?RHluYW1pYzkzOQ==?= Microsoft Outlook Discussion 4 8th Feb 2006 02:10 PM
Spell check subject line =?Utf-8?B?SmVubmlmZXIgRGFyZ2lz?= Microsoft Outlook Discussion 3 27th Jan 2005 10:16 PM
com addin to check blank subject line Raymond Geering Microsoft Outlook Program Addins 2 17th Dec 2004 07:25 AM
Re: Spell check error subject line OE 6.0. PA Bear Windows XP Internet Explorer 0 3rd Sep 2003 02:48 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:44 AM.