473,698 Members | 2,182 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Close All Instances of Microsoft Outlook with VBA

Hi Everybody

Windows XP, Access 2000, Outlook 2000

I am looking for a way to Close All Instances of Microsoft Outlook,
with VBA.

Both the "Seen One" and the unseen ones that you see when
you do a Ctrl Alt Del, and see them all sitting there in the task
manager.

I would like to have a Command Button that shuts them all.

Regards Bob

May 21 '06 #1
1 8574
Dim objs as Object
Dim obj as Object
Dim strSQL as String
Dim strWMI as String
strWMI = "winmgmts:"
strSQL = "Select * From Win32_Process "
strSQL = strSQL & "where Name = 'OUTLOOK.EXE'"
Set objs = GetObject(strWM I).ExecQuery(st rSQL)
For Each obj In objs
obj.Terminate
Next
Set objs = Nothing
HTH
Arthur

May 22 '06 #2

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

Similar topics

2
6303
by: davidw | last post by:
I want to check chose performance related parameters in my code. Thanks!
1
5563
by: Gary Cobden | last post by:
Hi I have a routine that uses VBA to open a hidden occurence of Excel, and do background computations. However, in the event that the routine terminates abnormally, I have not been able to find a way of closing this Hidden occurrence. I can close any foreground instances without any problem, but the same coding does not work for hidden occurences.
0
1630
by: gizmo | last post by:
We have a requirement to initiate more than one instance of an application using the filenames. (the example below will start two instances of MS Word). The problem is that we need to close each word document individually, but this does not appear possible using the Process object. When I run the example below the process object "p" can be viewed using Quick Watch however process object p2 is displayed as undefined. This appears to be...
7
2711
by: mg | last post by:
I need to first open WebForm2 from WebForm1 and then close WebForm1 without the end user having to press an OK button before the close can occur. For example, possibly Response.Write("<script language='javascript'>window.open ('WebForm2.aspx','two','menubar=no');</script>") Is there code that will accomplish this without using 3rd-
12
3099
by: Woody Splawn | last post by:
Is there a way to dis-able the closebox on a Slideout I would like my user to not be able to accidentally close a slideout when it's pinned. I mean the little x in the upper right hand corner of my slideout. Clicking this closes the slideout all together and leaves the user confused. Just wondering if this can be prevented.
5
3087
by: lindanr | last post by:
In ASP.NET 2005 I have an onblur="window.close()" javascript event in the <body> tag. When I click on the window's scrollbar, the window closes. The same code works fine in ASP.NET 2003. Any ideas?
7
1369
by: kannan | last post by:
hi, I am writing outlook-addin application using C#. I am trying to import contact information (from text file) in Outlook using C# code. Below is my code. But once data is saved the Contact screen is not closing. I don't want to display any screens. I have tried oCustomContact.Display(false); but still it is displaying. Is there is anything I have to do? Please let me know. TextReader reader = new StreamReader(upLoadContacts);
2
7297
by: JC | last post by:
Anybody knows what problem has this code? I think, in the Garbage Collector? You know the Solution? The program in the test's case, whit 350 contacts, run OK before number 86. The error is a "Array index out of bounds". Microsoft.Office.Interop.Outlook._Application olApp = new Microsoft.Office.Interop.Outlook.ApplicationClass(); Microsoft.Office.Interop.Outlook._NameSpace olNs = olApp.GetNamespace("MAPI");
1
4674
by: chrisli | last post by:
Hey, i have written this code to read all Outlook Appointments from another user and fill them into my DGV. Public Sub ReadOtherUserAppointment(ByVal UserName As String) Dim objolApp As New Outlook.Application Dim objNS As Outlook.NameSpace Dim objRecip As Outlook.Recipient Dim objFolder As Outlook.MAPIFolder objNS = objolApp.GetNamespace("MAPI")
0
8673
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9156
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9021
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
6518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4365
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4614
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2327
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1998
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.