Outlook Macro (VBA) programming

M

Mark Landin

This is a wierd one (at least to me). I'm not a VBA expert by any
means.

I want to write a macro that, when Outlook 2003 executes it, causes
Outlook to close. That's all. No other functions. Just a macro that
says "Exit" or "Close Application" or "Alt-F4".

You can imagine that this is a difficult macro to record (even if
Outlook could record macros, how would you record THAT?)
 
K

Ken Slovak - [MVP - Outlook]

For a VBA macro running in Outlook the code would be quite easy:

Sub KillOutlook()
On Error Resume Next
Application.Quit
End Sub

Clicking on the Close box at the top right of the Outlook window does
the same thing, why do you need a macro for that?
 
M

Mark Landin

For a VBA macro running in Outlook the code would be quite easy:

Sub KillOutlook()
On Error Resume Next
Application.Quit
End Sub

Clicking on the Close box at the top right of the Outlook window does
the same thing, why do you need a macro for that?

I'm glad you asked! :)

In this case, I need Outlook to be open just long enough to process a
new Outlook profile for the user. Once the profile is processed, I
want Outlook to close. That's all.

If Outlook had a command-line switch that basically said "process the
profile, but don't do anything else", I'd use that switch, but to my
knowledge there isn't one. Is there?
 

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