Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.newusers
|
|||
|
|||
Reversing word order - is it possible?
Is there a way (apart from doing it manually, of course) of reversing the
word order of a block of text? So that, for example, "This sentence is normal" becomes "normal is sentence this"? Easy enough to do for four words, but (for reasons far too unbelievable to go into) I have to reverse several chunks of text running to a hundred words or so each. Many thanks, Bert www.bertcoules.co.uk |
#2
Posted to microsoft.public.word.newusers
|
|||
|
|||
Reversing word order - is it possible?
Bert,
There are probably better ways, but this seems to do the basic job. Select the sentence (minus the final punctuation) and run this macro: Sub RevOrder() Dim i As Long Dim myArray() As String Dim myStr As String myArray = Split(Selection.Text, " ") For i = UBound(myArray) To 0 Step -1 myStr = myStr + " " & myArray(i) Next i myStr = Trim(myStr) Selection.Delete Selection.InsertAfter myStr End Sub Bert Coules wrote: Is there a way (apart from doing it manually, of course) of reversing the word order of a block of text? So that, for example, "This sentence is normal" becomes "normal is sentence this"? Easy enough to do for four words, but (for reasons far too unbelievable to go into) I have to reverse several chunks of text running to a hundred words or so each. Many thanks, Bert www.bertcoules.co.uk |
#3
Posted to microsoft.public.word.newusers
|
|||
|
|||
Reversing word order - is it possible?
Greg Maxey wrote:
There are probably better ways, but this seems to do the basic job. Thanks so much. I appreciate it. Bert www.bertcoules.co.uk |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Reveal codes in a word document | Microsoft Word Help | |||
Why dont MS just f**king re-write Word from scratch? Its dogsh*t | Microsoft Word Help | |||
hard space between words. | Microsoft Word Help | |||
WP merge file to Word | Tables | |||
How can Word display full path of a file in the title bar? | Microsoft Word Help |