Macro with a pause

M

Mainlymary

Are you able to create a macro in Word that, when you run it, it will stop and wait for an entry from the user and then continue to run? I have done this in other word processors, but can't find how to do it in Word. Thanks bunches.
 
L

Larry

You can display a message box, and the macro won't continue to the next
step until you've responded to it.

For example, if you press OK, Goodby is typed. If you press Cancel, the
macro ends.

Selection.TypeText "Hello." & vbCr
If MsgBox("Say goodby?", vbOKCancel, "Test Macro") = vbOK Then
Selection.TypeText "Goodby."
End If

Larry



Mainlymary said:
Are you able to create a macro in Word that, when you run it, it will
stop and wait for an entry from the user and then continue to run? I
have done this in other word processors, but can't find how to do it in
Word. Thanks bunches.
 
H

Howard Kaikow

If by pause you mean that the macro allows the user to modify the document
before continuing, you can do that by using a modeless Userform which allows
the user to leave and then return to the userform. You need at least Word
2000 to do this officially.
--
http://www.standards.com/; See Howard Kaikow's web site.
Mainlymary said:
Are you able to create a macro in Word that, when you run it, it will stop
and wait for an entry from the user and then continue to run? I have done
this in other word processors, but can't find how to do it in Word. Thanks
bunches.
 

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