TIP: Word Macro for Pause

Re: How do I create a macro for pause to use in word? -- Elaine Johnston
Posted by Jean Ichbiah ® , Thu, Jul 26, 2001, 18:13:37 Reply Top Forum

Here is a Word macro that will position the cursor at the first &&& placeholder to allow you to type text at that place:



Sub FindNextPause()
'
' FindNextPause Macro
' Macro recorded 2001-07-26 by Marianne
'
Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
With Selection.Find
.Text = "&&&"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
If Selection.Text = "&&&" Then
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.TypeBackspace
Selection.TypeBackspace
Selection.TypeBackspace
Else
Selection.EndKey Unit:=wdStory
End If
End Sub



 

Now that you have it, let's see how to use it.

An easy way is to go to Tools - Macro - Record New Macro and name the macro FindNextPause. In addition, click on the keyboard icon and associate it with some convenient keystrokes, such as Ctrl; (In her article, Marianne suggested Ctrl& but ; is easier as it is not a shifted character.)

Then immediately go to Tools - Macro - Stop Recording.

You have now recorded an empty macro. If you go to Tool - Macro, select FindNextPause, and click on Edit, here is what you will see:




Sub FindNextPause()
'
' FindNextPause Macro
' Macro recorded 2001-07-26 by Elaine
'
End Sub




Now copy the full macro and paste it at the place of the empty one. That's all. You can now close the Microsoft Visual Basic window and use Ctrl; for finding placeholders and replacing them.

Jean Ichbiah

Related link: How to do the equivalent of Pause


Edit | Reply | Where? | | Original Message | Top | Current page | Author