L
Lionel H
On my Laptop I have Windows 2000 SP-4 & Outlook 2000 SR-1.
To avoid embarrassment when sending emails I have a simple ItemSend event
handler which checks for the existence of a summary line and, under certain
circumstances, attachments. It works.
On my desktop I have Windows XP SP-2 & Outlook 2002 SP-2. I have put the
same event handler into that. It works differently in one way, and not at all
in another.
The full event handler is below. The problems are:
1. The "boxes" from InputBox and Messagebox are hidden under the send mail
form rather than appearing on top which give the appearance of a screen
freeze. Once understood, this is annoying but can be worked round. Can it be
corrected?
2. Whether I leave the default or use an alternative, Item.Subject. is not
populated by the Inputbox call. I do not believe item.subject is a blocked
field, but I tried wrapping Redemption round it anyway with no effect. How do
I get this working in XP please?
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
If Item.Subject = "" Then
Item.Subject = _
InputBox( _
"Mail item needs title", _
"Empty Subject Event", _
Left(Item.Body, 25))
End If
If Item.Attachments.Count = 0 Then
If InStr(1, UCase(Item.Body), "PSA") Or _
InStr(1, UCase(Item.Body), "ATTACH") Then
If MsgBox( _
"No Attachments - Send anyway?", _
vbYesNo + vbQuestion, _
"Application_ItemSend") = vbNo Then
Cancel = True
End If
End If
End If
End Sub
To avoid embarrassment when sending emails I have a simple ItemSend event
handler which checks for the existence of a summary line and, under certain
circumstances, attachments. It works.
On my desktop I have Windows XP SP-2 & Outlook 2002 SP-2. I have put the
same event handler into that. It works differently in one way, and not at all
in another.
The full event handler is below. The problems are:
1. The "boxes" from InputBox and Messagebox are hidden under the send mail
form rather than appearing on top which give the appearance of a screen
freeze. Once understood, this is annoying but can be worked round. Can it be
corrected?
2. Whether I leave the default or use an alternative, Item.Subject. is not
populated by the Inputbox call. I do not believe item.subject is a blocked
field, but I tried wrapping Redemption round it anyway with no effect. How do
I get this working in XP please?
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
If Item.Subject = "" Then
Item.Subject = _
InputBox( _
"Mail item needs title", _
"Empty Subject Event", _
Left(Item.Body, 25))
End If
If Item.Attachments.Count = 0 Then
If InStr(1, UCase(Item.Body), "PSA") Or _
InStr(1, UCase(Item.Body), "ATTACH") Then
If MsgBox( _
"No Attachments - Send anyway?", _
vbYesNo + vbQuestion, _
"Application_ItemSend") = vbNo Then
Cancel = True
End If
End If
End If
End Sub