Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.newusers
Greek Dunigan Greek Dunigan is offline
external usenet poster
 
Posts: 1
Default recording keystrokes

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.


  #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.



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

See also http://www.gmayor.com/installing_macro.htm

--

Graham Mayor - Word MVP

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



"Graham Mayor" wrote in message
...
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.





Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Delay in keystrokes NevilleT Microsoft Word Help 3 September 5th 08 12:20 AM
Recording Changes to Changes GDCross Microsoft Word Help 0 October 12th 07 10:27 PM
Recording and Displaying Word Keystrokes blueideone Microsoft Word Help 3 July 25th 07 06:12 AM
Recording a Macro dorita Microsoft Word Help 1 October 17th 06 06:59 AM
Need two keystrokes to use " or ' TomBert Microsoft Word Help 2 July 21st 05 12:01 PM


All times are GMT +1. The time now is 12:45 AM.

Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.
Copyright 2004-2023 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"