Quit Event of Application

M

mookashi

hi all,

i have put a message in the quit event of the outlook applicatio
object. when im exiting from the file menu of the Outlook Explore
window this event is being fired. But when im closing it using th
"cross" button on the top right hand side its not getting fired.
any particular reason??


thank
 
K

Ken Slovak - [MVP - Outlook]

Is this in a COM addin or in VBA code? Quit isn't reliable in COM addins
depending on how Outlook is closed and in VBA code by the time it fires all
Outlook objects and globals are out of scope.
 
M

mookashi

well iam talking about a COM AddIn.

actually im trying to locate a problem which has been tormenting me for
some time now. im creating 3 different types of dynamic menu for my
outlook COM ADDIN. depending on the type of mail item being opened only
one of the 3 menus shd be visible, which im manipulating in the new
inspector event.


now 2 of the 3 menus get disabled and enabled properly. one menubar
however never comes on the first time i open the mail item. after i
close the inspector and then re open it then the menu comes on. i cant
figure out where im going wrong.

however after i made a slightly unrelated change in the code the other
day the menu seems to be coming on the first instance.
i just set the inspector and explorer objects to Nothing in their
respective Close events .
but Outlook somehow runs in the background when i quit using the cross
button.

so i was wondering how could i possibly quit outlook properly.

my major problem is that when im having issues like this with the menu
bars i dont know how to debug them
 
M

mookashi

well iam talking about a COM AddIn.

actually im trying to locate a problem which has been tormenting me fo
some time now. im creating 3 different types of dynamic menu for m
outlook COM ADDIN. depending on the type of mail item being opened onl
one of the 3 menus shd be visible, which im manipulating in the ne
inspector event.


now 2 of the 3 menus get disabled and enabled properly. one menuba
however never comes on the first time i open the mail item. after
close the inspector and then re open it then the menu comes on. i can
figure out where im going wrong.

however after i made a slightly unrelated change in the code the othe
day the menu seems to be coming on the first instance.
i just set the inspector and explorer objects to Nothing in thei
respective Close events .
but Outlook somehow runs in the background when i quit using the cros
button.

so i was wondering how could i possibly quit outlook properly.

my major problem is that when im having issues like this with the men
bars i dont know how to debug the
 
M

mookashi

well iam talking about a COM AddIn.

actually im trying to locate a problem which has been tormenting me fo
some time now. im creating 3 different types of dynamic menu for m
outlook COM ADDIN. depending on the type of mail item being opened onl
one of the 3 menus shd be visible, which im manipulating in the ne
inspector event.


now 2 of the 3 menus get disabled and enabled properly. one menuba
however never comes on the first time i open the mail item. after
close the inspector and then re open it then the menu comes on. i can
figure out where im going wrong.

however after i made a slightly unrelated change in the code the othe
day the menu seems to be coming on the first instance.
i just set the inspector and explorer objects to Nothing in thei
respective Close events .
but Outlook somehow runs in the background when i quit using the cros
button.

so i was wondering how could i possibly quit outlook properly.

my major problem is that when im having issues like this with the men
bars i dont know how to debug the
 
K

Ken Slovak - [MVP - Outlook]

The interface you are using doesn't post any of the preceding thread which
makes it very difficult to follow a thread. Please do so manually, as you've
been asked to do many times already.

There are cases where an Inspector Close event won't fire. In cases like
that you would need to also handle events for the Inspector's CurrentItem
and get a Close in the item. This should be done in an Inspector wrapper
class module.

Without seeing your code there's no way anyone could see what's going wrong.
However the methods of handling closing Explorers and how and when to
release your Outlook objects is shown in the ItemsCB VB6 COM addin sample
located on the Resources page at www.microeye.com. I would suggest you
download and study that sample since it shows Outlook COM addin best
practices and workarounds for common Outlook COM addin bugs.
 

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