The code below will not generate an error message, but the rng1.MoveStart command will be ignored.
Sub MoveStart() Dim rng1 As WebDesignerPage.TextRange Set rng1 = WebDesigner.ActiveDocument. _ Selection.createRange rng1.MoveStart "character", 4 rng1.moveEnd "character", 6 rng1.Select Debug.Print rng1.Text End Sub
Workaround: Put the MoveEnd command before the MoveStart Command as shown below.
Sub MoveStart() Dim rng1 As WebDesignerPage.TextRange Set rng1 = WebDesigner.ActiveDocument. _ Selection.createRange rng1.moveEnd "character", 6 rng1.MoveStart "character", 4 rng1.Select Debug.Print rng1.Text End Sub
I believe I have tried all positive integer values, negative integer values and zero value in combination with making the MoveEnd value either smaller than or greater than or equal to the MoveStart value.
It appears to consistently not work in all cases.