A
Armin Simon
Hi NG,
I experience a strange issue with Outlook 2007:
I implemented a checking script in december last year which uses the
'application.itemsend methode to catch a mail before sending, checking
if there is the word 'attached' in the body or the subject is empty and
pops up if so.
This works great... so I suggest to implement these to some collegues.
This morning one of them called me and told me his implementation does
not work anymore... I checked mine... Does not work anymore too.
Here is the code I used:
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As
Boolean)
Dim ans
If InStr(1, Item.Body, "attached", vbTextCompare) > 0 Then
If Item.Attachments.Count = 0 Then
ans = MsgBox("Attachment missing, send anyhow?", vbYesNo)
If ans = vbNo Then Cancel = True
End If
End If
If Item.Subject = "" Then
MsgBox "Please use a valid subject!"
Cancel = True
End If
End Sub
I tried to find the error and toggled breakpoints on... but it seems the
script will not get executed at all.
I´m very confused.
Does anyone have any ideas what may the cause why this does not work
anymore. May there is a switch which prevents execution?
I appreciate any type of help or hints where I´m able to check
something.
Thanks a lot
/AS
I experience a strange issue with Outlook 2007:
I implemented a checking script in december last year which uses the
'application.itemsend methode to catch a mail before sending, checking
if there is the word 'attached' in the body or the subject is empty and
pops up if so.
This works great... so I suggest to implement these to some collegues.
This morning one of them called me and told me his implementation does
not work anymore... I checked mine... Does not work anymore too.
Here is the code I used:
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As
Boolean)
Dim ans
If InStr(1, Item.Body, "attached", vbTextCompare) > 0 Then
If Item.Attachments.Count = 0 Then
ans = MsgBox("Attachment missing, send anyhow?", vbYesNo)
If ans = vbNo Then Cancel = True
End If
End If
If Item.Subject = "" Then
MsgBox "Please use a valid subject!"
Cancel = True
End If
End Sub
I tried to find the error and toggled breakpoints on... but it seems the
script will not get executed at all.
I´m very confused.
Does anyone have any ideas what may the cause why this does not work
anymore. May there is a switch which prevents execution?
I appreciate any type of help or hints where I´m able to check
something.
Thanks a lot
/AS