H
Huw
This sounds like a stupid question, as normally the problem is normally
getting outlook to close down cleanly.
What my application does is create a new instance of Outlook.Application,
and then executes some code in one of the loaded addins. The code in the
addin is executed on a different thread and the call returns almose
immediately.
When it returns, the application closes down and releases it's reference to
outlook. This causes outlook to shutdown, destroying the thread that's
busy!
What I want to do is block outlook from closing down for the time the addin
is executing the code in the thread.
I thought I could just add another reference to outlook.application (from
inside the addin) and that would keep it alive, but it doesn't seem to do
the trick.
I then tried adding a reference to the object returned by
Outlook.Application.GetNamespace("MAPI") (thinking that there was some
perculiar behaviour with outlook), but the same behaviour.
I dont understand why outlook is closing down even though I have addref'd
the app object many times.
Does anyone have any ideas why addrefing does not work, or know of any way I
call tell outlook that it should not shut down.
Thanks in advance,
Huw
getting outlook to close down cleanly.
What my application does is create a new instance of Outlook.Application,
and then executes some code in one of the loaded addins. The code in the
addin is executed on a different thread and the call returns almose
immediately.
When it returns, the application closes down and releases it's reference to
outlook. This causes outlook to shutdown, destroying the thread that's
busy!
What I want to do is block outlook from closing down for the time the addin
is executing the code in the thread.
I thought I could just add another reference to outlook.application (from
inside the addin) and that would keep it alive, but it doesn't seem to do
the trick.
I then tried adding a reference to the object returned by
Outlook.Application.GetNamespace("MAPI") (thinking that there was some
perculiar behaviour with outlook), but the same behaviour.
I dont understand why outlook is closing down even though I have addref'd
the app object many times.
Does anyone have any ideas why addrefing does not work, or know of any way I
call tell outlook that it should not shut down.
Thanks in advance,
Huw