Closing Outlook correctly

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

Guest

I need to close outlook fro a spearate process or detect that it cannot be
closed. What I am proposing to do it open outlook and then quit. Check if
there is any explorer or inspector [cannot close]. If none them delete any
process outlook.exe there might be in the background.

Do this sound sound?
 
If there are no Explorers or Inspectors then Outlook is either running with
no UI or the UI is closing down. You can call Application.Quit to get
Outlook to close or you could even send a Windows message to Outlook to shut
down but if any other code is running in the background that has Outlook
references Outlook would still hang in the background. Forcing the various
Outlook windows to close using Win32 API calls might not be such a great
idea, it could corrupt things nicely.

What are you trying to do and why?
 
I'm trying to close outlook prior to running a tool EMWProf which updates
profiles.

--
Philip Painter, HP


Ken Slovak - said:
If there are no Explorers or Inspectors then Outlook is either running with
no UI or the UI is closing down. You can call Application.Quit to get
Outlook to close or you could even send a Windows message to Outlook to shut
down but if any other code is running in the background that has Outlook
references Outlook would still hang in the background. Forcing the various
Outlook windows to close using Win32 API calls might not be such a great
idea, it could corrupt things nicely.

What are you trying to do and why?




PhilipPainter said:
I need to close outlook fro a spearate process or detect that it cannot be
closed. What I am proposing to do it open outlook and then quit. Check if
there is any explorer or inspector [cannot close]. If none them delete any
process outlook.exe there might be in the background.

Do this sound sound?
 
Then checking for Explorers.Count and Inspectors.Count and issuing
Application.Quit is probably the best way to go.
 
Back
Top