Discussion Locked

Automatically exiting program

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Do you now a way to run a command that will exit out of a running Windows program ?

I want to backup my Outlook pst file from time to time but need to exit it before I do so.

I'd like to schedule it's exit , backup and then start it up again.

3 replies

by tech_dk

I'm not sure how to make Outlook automatically execute this, but there is a way to have a macro automatically close Outlook:

In MS Outlook go to Tools->Macro->Visual Basic Editor

Copy/Paste the following into a Module then save and exit from Visual Basic.

Sub ExitOutlook()
Application.Quit
End Sub

If there is no module, right click on the project and select 'Insert->Module'

Back in Outlook, go to 'Tools->macro->macros' play 'ExitOutlook' and it will shut down the program.
Another option is to ask this question in some type of VB forum and get a better answer so you could run a batch file that first runs a VB script that locates and closes any Outlook windows and then performs your backup.

Hope this helps.

This discussion is closed to new replies.