Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.newusers
Bert Coules Bert Coules is offline
external usenet poster
 
Posts: 123
Default 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   Report Post  
Posted to microsoft.public.word.newusers
Greg Maxey Greg Maxey is offline
external usenet poster
 
Posts: 171
Default 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   Report Post  
Posted to microsoft.public.word.newusers
Bert Coules Bert Coules is offline
external usenet poster
 
Posts: 123
Default 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

Posting Rules

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Reveal codes in a word document FUN101 Microsoft Word Help 4 May 16th 23 08:47 PM
Why dont MS just f**king re-write Word from scratch? Its dogsh*t Word Hater Microsoft Word Help 33 May 5th 23 02:52 PM
hard space between words. Sandy L Microsoft Word Help 7 May 5th 06 08:25 PM
WP merge file to Word sstires Tables 4 February 14th 06 06:26 PM
How can Word display full path of a file in the title bar? SAsif Microsoft Word Help 1 January 26th 06 04:32 PM


All times are GMT +1. The time now is 09:00 PM.

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

About Us

"It's about Microsoft Word"