Is Microsoft Outlook running? + How do I start It

Pingolin used Ask the Experts™
Can someone tell me how I can see if Microsoft Outlook is running or not.

How do I start Microsoft Outlook within my VB-program?

Please provide me with some code.

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
You can use the GetObject function to try to get a reference to the Outlook "Applciation" object. If an error occurs (trap it), it's not running.

To start it, you can either call the outlook .exe with the Shell function if you want it to be visible to the user or use CreateObect to keep it to yourself.
"Automating Outlook from other Microsoft Office applications"
This explains the basics of what I suggested

From Microsoft Office XP Developer documentation:
"Office Application Automation"

Using the CreateObject and GetObject Functions (also from Microsoft Office XP Developer documentation)

CreateObject example on MSDN


You can use the MAPI controls and if outlook is open it will use the open connection.  If it isn't open it will prompt the user to open it.  Here is a quick example using the component reference to Microsoft Mapi Controls 6.0

MAPIMessage.SessionID = MAPISession.SessionID
MAPIMessage.MsgIndex = -1

This will open Outlook to create a new message.  Then you can do whatever you want with the MapiMessage Control.


Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial