Link to home
Start Free TrialLog in
Avatar of Pingolin
Pingolin

asked on

Is Microsoft Outlook running? + How do I start It

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.

Thanx.
Avatar of Monchanger
Monchanger
Flag of United States of America image

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.
ASKER CERTIFIED SOLUTION
Avatar of Monchanger
Monchanger
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ping,

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
MAPIMessage.Compose

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

G