View Single Post
 
Old 05-10-2016, 02:09 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,371
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

For that, you could use a macro like:
Code:
Sub Demo()
Randomize Timer
Dim StrTxt As String, StrTmp As String, StrOut As String
Dim i As Long, j As Long
With Selection.Range
  .Start = .Sentences.First.Start
  .End = .Sentences.First.End
  While .Characters.Last Like "[.!:;?" & vbCr & vbTab & vbLf & "]"
    .End = .End - 1
  Wend
  StrTxt = " " & Trim(.Text) & " "
  While Len(Trim(StrTxt)) > 1
    i = UBound(Split(StrTxt, " ")) + 1
    j = Int(Rnd * i)
    If j > 0 Then
      StrTmp = Split(StrTxt, " ")(j) & " "
      StrOut = Trim(StrOut & " " & StrTmp)
      StrTxt = Replace(StrTxt, " " & StrTmp, " ", 1, 1)
    End If
  Wend
  .Text = StrOut
End With
End Sub
Simply click anywhere in the sentence and run the macro. Do note, though, that a VBA sentence is not the same as a grammatical sentence - periods used in abbreviations, for example, get interpreted by VBA as sentence ends.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote