"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.
|