Advertisement
Guest User

Untitled

a guest
Feb 24th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub task213312044()
  2. Selection.MoveEnd Unit:=wdLine, Count:=1
  3. Do While (Len(Selection.Text) > 1)
  4.  res = ""
  5.  s = Selection.Text
  6.  len_s = Len(s)
  7.  LastChar = Mid(s, len_s, 1)
  8.  LastCharIsSpec = LastChar = Chr(11) Or LastChar = Chr(13)
  9.  
  10.  If LastCharIsSpec Then len_s = len_s - 1
  11.  For i = 1 To len_s
  12.  res = Mid(s, i, 1) & res
  13.  Next
  14.  
  15.  If LastCharIsSpec Then res = res & LastChar
  16.  
  17.  Selection.Text = res
  18.  Selection.MoveRight Unit:=wdCharacter, Count:=1
  19.  Selection.MoveEnd Unit:=wdLine, Count:=1
  20. Loop
  21. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement