Terminate WORD with a macro???

K

Ken Soenen

Can MS Word be closed automatically after running a Macro, or from the
Macro??
 
G

Greg Maxey

Yes. Here is an example.

Sub CloseWord()
If MsgBox("Do you want to close Word?", _
vbQuestion + vbYesNo, "Question") = vbYes Then
Application.Quit
End If
End Sub
 
J

Jezebel

If you wanted to be really slick, you would include a check for any unsaved
documents.
 
K

Ken Soenen

I must have looked in the Application method list 500 times. I don't know
why I couldn't find QUIT. But, it's there!!!
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