Strange issue with application.itemsend

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
 
M

Michael Bauer [MVP - Outlook]

have you already checked Help/Disabled Items, whether VBA is listed or not?

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: <http://www.vboffice.net/product.html?pub=6&lang=en>


Am Thu, 08 Jan 2009 09:35:17 -0800 schrieb Armin Simon:
 
A

Armin Simon

have you already checked Help/Disabled Items, whether VBA is listed or
not?

Hi Michael,

thanks a lot for the hint. Unfortunately I checked this before... No entry.

Do you may have any further ideas where I´m able to look about?

Cheers
/AS
 
M

Michael Bauer [MVP - Outlook]

See Tools/Trust Center whether security is set not to execute VBA at all.

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: <http://www.vboffice.net/product.html?pub=6&lang=en>


Am Thu, 08 Jan 2009 23:23:21 -0800 schrieb Armin Simon:
 
A

Armin Simon

See Tools/Trust Center whether security is set not to execute VBA at all.

Woahh,
Thanks a lot!
Sometimes easy switches do the trick ;-)

Cheers
/AS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top