moveToPoint Method

Microsoft FrontPage Visual Basic

moveToPoint Method

Moves the start and end positions of an IHTMLTxtRange object to the specified point.

expression.moveToPoint(x, y)

expression    Required. An expression that returns an IHTMLTxtRange object.

x   Required Long. The horizontal position from the left edge of the application window.

y   Required Long. The vertical position from the top edge of the application window.

Remarks

The x and y parameters for the moveToPoint method are coordinates from the upper-left corner of the browser window. This includes the toolbars and Views bar in the Microsoft FrontPage application.

Example

This example inserts text into the active document, and then moves and selects the range and replaces it with new text.

    Sub UseMoveToPointMethod()
    Dim objRange As IHTMLTxtRange

    ActiveDocument.body.innerHTML = "<p>This is a test.</p>"
    Set objRange = ActiveDocument.Selection.createRange

    With objRange
        .moveToPoint 74, 28
        .expand "word"
        .moveStart "word", -1
        .Select
        .Text = "FrontPage"
    End With
End Sub