MoveSelectionToView Method

Moves the user's selection into the viewer control window.

expression.MoveSelectionToView(pdispSelection)

*expression   * Required. An expression that returns an MiDocView object.

pdispSelection    Required Object. An IMiSelectableItem object (returned by the viewer control's TextSelection property) or an IMiSelectableImage object (returned by the viewer control's ImageSelection property).

Remarks

The TextSelection and ImageSelection properties raise a run-time error if nothing is selected in the viewer control.

Example

The following example moves the user's selection back into the the viewer control window.

Sub TestMoveSelectionToView()

  If Not MiDocView1.TextSelection Is Nothing Then
      MiDocView1.MoveSelectionToView MiDocView1.TextSelection
  Else
      MsgBox "Nothing is selected.", vbExclamation + vbOKOnly
  End If

End Sub

Applies to | MiDocView Object