Outlook Macro (VBA) programming

  • Thread starter Thread starter Mark Landin
  • Start date Start date
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?)
 
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?
 
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?
 
Back
Top