Access and Outlook

G

Guest

I know you can open outlook with a macro, easy right???? It works great. However, can anyone tell me if you can close outlook with a macro or other VBA code? I can't find anything on it so I assume no, but it would be wonderful if you could. Any help would be appreciated. Thank you!
 
B

Bryan Reich [MSFT]

If you open it in VBA code
i.e.
Dim outlookObj As Object
Set outlookObj = CreateObject("Outlook.Application")
' Work with outlook here, show it to the user, run commands on it, etc.

now you have a reference to the outlook instance you opened (the object
"outlookObj"), so you can interact with it to close it at some future time:

outlookObj.Quit()
Set outlookObj = Nothing

--
Bryan Reich
Microsoft Office
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm


Lucille said:
I know you can open outlook with a macro, easy right???? It works great.
However, can anyone tell me if you can close outlook with a macro or other
VBA code? I can't find anything on it so I assume no, but it would be
wonderful if you could. Any help would be appreciated. Thank you!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top