I must be something DUMB here - but WHAT?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

See VB code below.

Please can anyone tell me why, after the myExplorer_Close event code executes in Form2 and Form2 unloads, Outlook.exe is still running in Task Manager - it only disappears when Form1 is unloaded

Form
-------

Private Sub Command1_Click(
Form2.Show vbModal, M
End Su

Form
-------

Private myOlApp As Outlook.Applicatio
Private myNameSpace As Outlook.NameSpac
Private myFolder As Objec
Private myTopFolder As Objec
Private WithEvents myExplorer As Outlook.Explore

Private Sub Command1_Click(

Set myOlApp = New Outlook.Applicatio
Set myNameSpace = myOlApp.GetNamespace("MAPI"
Set myTopFolder = myNameSpace.Folders("St Columba Calendar"
Set myFolder = myTopFolder.Folders("Calendar"
Set myExplorer = myFolder.GetExplorer(olFolderDisplayNoNavigation
myExplorer.Displa

End Su

Private Sub myExplorer_Close(
myOlApp.Qui
Set myOlApp = Nothin
Unload M
End Su
 
You need to dereference all Outlook objects by setting them to Nothing when
you're done with them, i.e. in your Form2_Unload procedure.
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



AndyK said:
See VB code below.

Please can anyone tell me why, after the myExplorer_Close event code
executes in Form2 and Form2 unloads, Outlook.exe is still running in Task
Manager - it only disappears when Form1 is unloaded?
 
Back
Top