Hi, RobiNew! Try this:
Code:
Sub MovingChr()
Set oRng = ActiveDocument.range
With oRng.Find
.text = "<p class=MyPar>"
.Execute
End With
If oRng.Characters.Last.Next Like "<" Then
oRng.MoveEnd unit:=wdCharacter, count:=1
oRng.MoveEndUntil Cset:="<"
oRng.Collapse wdcollapsend
oRng.Select 'to see the cursor psn; if you are going to work with oRng, this line can be deleted
End If
End Sub
or this:
Code:
Sub MovingChr()
Set oRng = ActiveDocument.range
With oRng.Find
.text = "<p class=MyPar>"
.Execute
End With
oRng.Collapse wdcollapsend
If oRng.Characters.First Like "<" Then
oRng.Move unit:=wdCharacter, count:=1
oRng.MoveUntil Cset:="<"
oRng.Select 'to see the cursor psn; if you are going to work with oRng, this line can be deleted
End If
End Sub