Prevent Outlook 2007 from closing

  • Thread starter Thread starter Ivica Muruzovic
  • Start date Start date
I

Ivica Muruzovic

Is there a way to prevent outlook 2007 from closing and can I get
event beforeDelete for mailItem on application level
 
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.
 
You write: "There is nothing else equivalent unless you are using
Outlook 2007."

I'm using Outlook 2007.
Did you mean Outlook 2003?
 
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.
 
Back
Top