Open/Close Outlook - Via Excel VBA

Choppork

Member
Outlook version
Outlook 2013 32 bit
Email Account
Exchange Server
I am looking for the correct syntex to open and then close Outlook via Excel VBA code.

The code would reside in an Excel application.

Thank you in advance.

Choppork

1325 CDT

June 19, 2013
 

larry

Senior Member
Outlook version
Outlook 2010 64 bit
Email Account
Exchange Server
This would open outlook:
Dim outlookApp As Outlook.Application
' create Outlook session
Set outlookApp = GetOutlookApp

I'm not sure about closing.

For some Excel sample code, see http://www.jpsoftwaretech.com/excel-vba/send-email-from-excel/. It's all for sending email, but the same basic steps are used to create appointments or contacts.
 

Choppork

Member
Outlook version
Outlook 2013 32 bit
Email Account
Exchange Server
This would open outlook:

Dim outlookApp As Outlook.Application

' create Outlook session

Set outlookApp = GetOutlookApp

I'm not sure about closing.

For some Excel sample code, see http://www.jpsoftwaretech.com/excel-vba/send-email-from-excel/. It's all for sending email, but the same basic steps are used to create appointments or contacts.
Larry - Thank you for the response!!

While you are correct with the above VBA code, when embedded within an application, that code will open Outlook as a background application only, (i.e. - not visable), and the Outlook application will close when the calling application VBA code is stopped.

Also - the normal (expected) syntex to make the (opened) Outlook application visable, (i.e. (outlookApp.visable=True), do not work.

I (should) have made my request more clear, the code I would like would open MS Outlook, make it visable, and allow the application to remain open when the calling code is halted. I have the code to close an open Outlook appplication.

Any/all assistance is greatly appreceiated!!

Thank you in advance.

Choppork

1330 CDT

June 20, 2013
 
Top