Prevent Outlook 2007 from closing

I

Ivica Muruzovic

Is there a way to prevent outlook 2007 from closing and can I get
event beforeDelete for mailItem on application level
 
K

Ken Slovak - [MVP - Outlook]

No, not unless you write code that hangs Outlook or that starts Outlook with
no UI and keeps it running. Synch software does that. But that won't prevent
the user from closing the UI portion of Outlook.

BeforeDelete is at the item level only and will only fire in an open item
when that item is deleted using the File menu in the open item. There is
nothing else equivalent unless you are using Outlook 2007.
 
I

Ivica Muruzovic

You write: "There is nothing else equivalent unless you are using
Outlook 2007."

I'm using Outlook 2007.
Did you mean Outlook 2003?
 
K

Ken Slovak - [MVP - Outlook]

No, I meant Outlook 2007. In that version there's a new event that's perfect
for what you want. The new Folder.BeforeItemMove event. The VBA signature is
BeforeItemMove(Item As Object, MoveTo As Folder, Cancel As Boolean). The
item is the object being moved/deleted, MoveTo is a Folder object if moving
the item or null (Nothing) if deleting the item, and setting Cancel = true
will cancel the operation before it occurs.
 

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