View Single Post
  #2   Report Post  
Posted to microsoft.public.word.newusers
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default recording keystrokes

You cannot record loops with the macro recorder.
The following will replace the first word in each paragraph in the selected
text with the word(s) defines in sText

Sub ReplaceFirstWord()
Dim oPara As Paragraph
Dim sText As String
sText = "Replacement Text"
For Each oPara In Selection.Range.Paragraphs
oPara.Range.Words(1).Text = sText & Chr(32)
Next oPara
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



"Greek Dunigan" wrote in message
m...
How do I record keystrokes and then evoke a command to repeat those
keystrokes? For instances; I want to change the first word in a numbered
list in the document all the way through the document.