Outlook Process not getting terminated even after closing outlook.

  • Thread starter Thread starter Sunil Dutt Anthwal
  • Start date Start date
S

Sunil Dutt Anthwal

Hi All

I am customizing my outlook, and using a vb dll plug in for it, I am
using a Folder_switch() method to trap the folder click event, for
which I had written in my code :

'In declaration portion
Dim WithEvents currExplorer As outlook.Explorer

'In initialization
Set currExplorer = objOutlook.ActiveExplorer

'In code body
Private Sub currExplorer_FolderSwitch()
MsgBox objOutlook.ActiveExplorer.CurrentFolder
End Sub

'Cleaning all objects

Set currExplorer = Nothing
Set objNSpace = Nothing
Set objOutlook = Nothing
Set fldrInbox = Nothing
Set InboxMsgs = Nothing
Set Msg = Nothing
With this code if I run my Outlook, I am able to work with
currExplorer_FolderSwitch() function but while closing my outlook it
is not getting terminated, and Outlook.exe is shown in my task
manager.


Now if I remove the initialization part or change it to :
currExplorer = objOutlook.ActiveExplorer

And then compile it and start my outlook, outlook runs and while
closing outlook it gets removed completely, no process in task
manager. But then my
currExplorer_FolderSwitch() function doesn't work.

Thanks in adv.
Regards
Sunil Dutt
 
I would add that you need to handle all errors in your add-
in. Not handling errors is another reason why Outlook
won't shut down when you're done with it; I have read that
an un-handled error can cause Outlook to lock up, though
(fortunately) I haven't experienced this myself.

-Andrew Cushen
===================================
 
Back
Top