Home
Forums
New posts
Search forums
Articles
Latest reviews
Search resources
Members
Current visitors
Newsgroups
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Home
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook Interoperability
Bulletproof Exiting Outlook (and not crashing)
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Derek Hart, post: 13743542"] When I run this process, it works fine the first time. After the first run, Outlook is running. Then let's say the user exits Outlook. It is still in the task manager. Then when your code looks to see if it is there, it is. But then the code tries to get the Outlook with this line: objOutlook = TryCast(Marshal.GetActiveObject("Outlook.Application"), Outlook.Application) But it is not really there. So the code errors. Should I trap for that and then get Outlook the other way: Dim _app As New Outlook.ApplicationClass() objOutlook = DirectCast(_app, Outlook.Application) I guess the global variable keeps Outlook in the task manager, but even when I was not doing this process Outlook still stayed in the task manager. It never seems to exit, even with this: Marshal.ReleaseComObject(objOutlook) objOutlook = Nothing And is there code to exit it properly in the Explorer and Inspector Close() events? I was unclear on this... I am not displaying Outlook UI, but just WindowsForms windows that read and write data to/from the pst file. Do I have to use these events to properly close and get rid of Outlook in the task manager? [/QUOTE]
Verification
Post reply
Home
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook Interoperability
Bulletproof Exiting Outlook (and not crashing)
Top