A
avkokin
Hello.
I need to turn over all words in selected text by StrReverse function.
But these words should be in right order (like in sentense). Reversing
should be only for words, not for all string. For example, I do that:
Sub reverse()
Dim strStroka As String
Dim strRev As String
strStroka = Selection.Text
strRev = StrReverse(strStroka)
Selection.Text = Replace(strStroka, strStroka, strRev)
End Sub
This code is reversed all string. Thus the order of words into
sentense is broke. I try it otherwise, but I stop by using of cycle:
Sub reverse2()
Dim myArr() As String
Dim i As Integer
Dim sStr As String
Dim strRev As String
sStr = Selection.Text
myArr = Split(sStr)
For i = 0 To myArr(sStr) 'this is error
strRev = StrReverse(sStr)
Selection.Text = Replace(sStr, sStr, strRev)
Next i
End Sub
Help me, please.
Thank you very much.
I need to turn over all words in selected text by StrReverse function.
But these words should be in right order (like in sentense). Reversing
should be only for words, not for all string. For example, I do that:
Sub reverse()
Dim strStroka As String
Dim strRev As String
strStroka = Selection.Text
strRev = StrReverse(strStroka)
Selection.Text = Replace(strStroka, strStroka, strRev)
End Sub
This code is reversed all string. Thus the order of words into
sentense is broke. I try it otherwise, but I stop by using of cycle:
Sub reverse2()
Dim myArr() As String
Dim i As Integer
Dim sStr As String
Dim strRev As String
sStr = Selection.Text
myArr = Split(sStr)
For i = 0 To myArr(sStr) 'this is error
strRev = StrReverse(sStr)
Selection.Text = Replace(sStr, sStr, strRev)
Next i
End Sub
Help me, please.
Thank you very much.