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: 13743295"] Wow... thank you for this code. A few things... I am wondering if I should simply run this code first to instantiate Outlook, and then use my code as I did before to go get it. Since you did not send me a function, it looks like I am not retrieving the instance from this routine and pulling it into another routine. A couple variables were not declared in your code, so I am unclear how to use this. Should I declare this as a global variable. If so, I tried that, and the code is having problems. Dim _outlookApp As Outlook.Application So in my routine I load Outlook this way: InstantiateOutlook() Then the global variable _outlookApp is used everywhere. But then at the end of my routine, I release the com object and set it to nothing. So then I thought I should put the code as follows in your routine. objOutlook = New Outlook.Application If collCount <> 0 Then ' Outlook already running, hook into the Outlook instance objOutlook = TryCast(Marshal.GetActiveObject("Outlook.Application"), Outlook.Application) But that code errors on the TryCast line. Please explain how to use this code appropriately. And I am unclear what the canQuit flag is used for: Dim canQuit As Boolean [/QUOTE]
Verification
Post reply
Home
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook Interoperability
Bulletproof Exiting Outlook (and not crashing)
Top