473,395 Members | 1,936 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How do I know if I should Application.Quit()?

I have an app that connects to Outlook and syncs up some contacts form a
Paradox database. How do I know if I should call MyOutlookAppObject.Quit()?
If I call quit from my app while I already have Outlook up and running it
will close Outlook down. If I don't call it and I didn't have outlook
already running it sometimes seems to leave a process running with no UI.

How do I do this correctly?

Thanks,
Jim
Nov 15 '05 #1
2 3875
There might be a better solution, but you could check to see if Outlook
is already running before you instantiate your MyOutlookAppObject. Like
this:

if (System.Diagnostics.Process.GetProcessesByName("OU TLOOK").Length > 0)
callQuit = false; // don't call Quit method
else
callQuit = true; // call Quit method

Erik

"Jim H" <no****@jimsaccount.com> wrote in message
news:Ov**************@TK2MSFTNGP11.phx.gbl...
I have an app that connects to Outlook and syncs up some contacts form a
Paradox database. How do I know if I should call MyOutlookAppObject.Quit()? If I call quit from my app while I already have Outlook up and running it
will close Outlook down. If I don't call it and I didn't have outlook
already running it sometimes seems to leave a process running with no UI.

How do I do this correctly?

Thanks,
Jim

Nov 15 '05 #2

Hi Jim,

Thanks for posting in this group.
Based on my understanding, you want to determine if there is any outlook
running instance in system.
This can be done through Process.GetProcessesByName method.
GetProcessesByName is helpful for getting and manipulating all the
processes that are associated with the same executable file. For example,
you can pass an executable file name as the processName parameter, in order
to shut down all the running instances of that executable file.

Note: The process name is a friendly name for the process, such as Outlook,
that does not include the .exe extension or the path.

For more information, please refer to the link below:
http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfsystemdiagnosticsprocessclassgetprocessestopi c2.asp

Have nice day!

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: The Roys | last post by:
Hi Im doing something wrong in quitting the Word.Application in my VB program. I have General Declarations Dim AppWord As Word.Application Form_Load() Set AppWord =...
2
by: Lauren Quantrell | last post by:
Running Access2000 ADP Project/MSDE on Windows XP... - I Open my Access ADP project. In the Windows Task Manager Processes window MSACCESS.EXE shows up. - I don't do anything else in Access. - I...
3
by: downwitch | last post by:
Greetings, I have an application which has recently gone from being one big piece of front-end code to being three, i.e. an mdb A that references an mda B and an mda C. (For what it's worth, in...
6
by: Peter Kleiweg | last post by:
I have an application written in Tkinter. There is a menu item 'quit' that calls the function 'quit'. If 'quit' is called, it first checks if there is unsaved data. If there is, it won't let the...
0
by: Alan T | last post by:
I tried to close the word document object and word application: private Interop.Word.Application WordApp; private Interop.Word.Document WordDoc; // close word and quit word application ...
3
by: rdemyan via AccessMonster.com | last post by:
Sometimes users (including myself) accidentally click on the application close icon in the application menu bar when they meant to just click on the 'X' for the form. Of course the app closes and...
0
by: Alan T | last post by:
private Interop.Word.Application _mergeWordApp; I tried to quit the Word application: _mergeWordApp.Application.Quit(ref _notTrue, ref _newMissing, ref _newMissing); However, I got...
2
by: Alan T | last post by:
private Interop.Word.Application _wordApp; What is the differences betwenn _wordApp.Quit(...) and _wordApp.Application.Quit(...) ?
9
by: Andy | last post by:
Just noticed something interesting in the above. If you have your program file set to "Compact on Close" in access 2007 (which is desirable when you have a larger program that frequently needs...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.