Hello everyone
My first experiment with the selection through levels didn't end well.
So i tried to find another way and I'm almost there, but I'm sure my code is wrong in some parts.
Here's the code
Sub test()
Dim flag As Boolean
flag = True
While flag = True
Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
If Strings.Right(Selection.Range.Text, 1) = "!" Then
flag = False
End If
Wend
End Sub
This is perfect to select to a specific character, but if i change the selection range from wdcharacter to wdword it doesn't function anymore.
I'm thinking that the problem could be in the text range, but at this point I'm stuck and i can't make it work and as soon as i launch the macro, the program freeze and crash.
Could someone please help me?
Thanks for the attention given
GDA
My first experiment with the selection through levels didn't end well.
So i tried to find another way and I'm almost there, but I'm sure my code is wrong in some parts.
Here's the code
Sub test()
Dim flag As Boolean
flag = True
While flag = True
Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
If Strings.Right(Selection.Range.Text, 1) = "!" Then
flag = False
End If
Wend
End Sub
This is perfect to select to a specific character, but if i change the selection range from wdcharacter to wdword it doesn't function anymore.
I'm thinking that the problem could be in the text range, but at this point I'm stuck and i can't make it work and as soon as i launch the macro, the program freeze and crash.
Could someone please help me?
Thanks for the attention given
GDA