Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook and VBA (http://www.outlookbanter.com/outlook-vba/)
-   -   Closing Outlook correctly (http://www.outlookbanter.com/outlook-vba/12494-closing-outlook-correctly.html)

PhilipPainter April 23rd 06 06:36 PM

Closing Outlook correctly
 
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?
--
Philip Painter, HP

Ken Slovak - [MVP - Outlook] April 24th 06 02:50 PM

Closing Outlook correctly
 
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?

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"PhilipPainter" wrote in message
...
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?
--
Philip Painter, HP



PhilipPainter April 25th 06 09:45 AM

Closing Outlook correctly
 
I'm trying to close outlook prior to running a tool EMWProf which updates
profiles.

--
Philip Painter, HP


"Ken Slovak - [MVP - Outlook]" wrote:

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?

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"PhilipPainter" wrote in message
...
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?
--
Philip Painter, HP




Ken Slovak - [MVP - Outlook] April 25th 06 02:50 PM

Closing Outlook correctly
 
Then checking for Explorers.Count and Inspectors.Count and issuing
Application.Quit is probably the best way to go.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"PhilipPainter" wrote in message
...
I'm trying to close outlook prior to running a tool EMWProf which updates
profiles.

--
Philip Painter, HP




All times are GMT +1. The time now is 05:03 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com