Checking whether a program is running or not

While performing installation, sometimes, we need to check whether the instance of a particualr program exist or not.
I got this problem while installing my plug-in. Outlook should be closed before the installation starts. So, I need to check for the existance of Outlook before installation. After so many days and lot of efforts, finally I have got a solution for this.

While Process.GetProcessesByName(“Outlook”).Length > 0

MsgBox(“Notepad is open”)
End While

MsgBox(“Outlook is still open. Please close it”)

End While

This loop will iterate until the Outlook is closed.

We can also close a program forcibly using the following code.

Dim myProcesses() As Process

Dim instance As Process

myProcesses = Process.GetProcessesByName(“Outlook”)

For Each instance In myProcesses

instance.CloseMainWindow() ‘ This will close the application that is running

Next

Lazy add-ins

VSTO add-ins some times  irritates us by causing delay. No work around works for it and atleast a clue will not be available for us to work on that. It works fine in some systems. It loads slowly in some other systems. Some times, it even does not load in some systems.  30 second dealy, slow start-up, checking for certificate, publishing problems etc. comes under this domain.
Forums are the best places to get solutions to this kind of problems. Ofcourse, obviously almost every programmer will be going through Forums, especially VSTO programmers.
These are the links from forums for those who are sufffering from lazy add-ins (loading slowly) problem. These are the dicsussions on the delay problem. Hope this helps!

Slow Outlook startup

30 second start up delay

Performance problems for network profiles

Slow start-up time

A very technical (related link)

Professional Outlook 2007 Programming

Outlook ebook

Professional Outlook 2007 Programming

Written by one of the most popular and knowledgeable Microsoft Outlook MVPs, this book emphasizes the many new and exciting Outlook 2007 programming features. Ken Slovak shows you all you need to know to develop everything from Outlook custom forms and personal productivity macros to advanced COM add-ins that use a range of Microsoft technologies.

The Outlook 2007 model fulfills many of the requests that Outlook developers have been making for years. You’ll see how many of the programming properties that are considered vital, but were previously unavailable in older versions of Outlook, now exist. Real-world examples show you how to solve common Outlook programming problems. Plus, you’ll learn common workarounds for Outlook programming bugs. You’ll quickly discover why you’ll rarely if ever have to leave the Outlook object model to do what you want with your code when using Outlook 2007.

Download Here

VSTO Forums

Add-In Express Forum:
http://www.add-in-express.com/forum/list.php?FID=5
MSDN Forum:
http://social.msdn.microsoft.com/Forums/en-US/vsto/threads
Microsoft`s Google Group for Interoperability (Interop Assemblies) related problems:
http://groups.google.com/group/microsoft.public.outlook.interop/topics
Microsoft`s Google Group for Installation problems of VSTO Add-In:
http://groups.google.com/group/microsoft.public.outlook.installation/topics
List of  Google Groups on VSTO Outlook Add-Ins:
http://groups.google.com/groups/dir?sel=usenet%3Dmicrosoft.public.outlook