GoToAnnotationScope

Syntax

GoToAnnotationScope

Remarks

Selects the range of document text associated with the annotation containing the insertion point. If the insertion point is not within an annotation in the annotation pane, an error occurs.

The range, or "scope," of the annotation is defined as the text that was selected when the annotation mark was inserted. This text appears shaded when the insertion point is within the annotation in the annotation pane. If no text was selected when the annotation was inserted, GoToAnnotationScope moves the insertion point to the position immediately preceding the annotation mark in the document text.

Example

This example copies to the Clipboard the document text associated with the annotation containing the insertion point. The first If instruction ensures that the annotation pane is open and the insertion point is within it. Then GoToAnnotationScope selects the associated document text. The second If instruction ensures that text is selected before running EditCopy.


If ViewAnnotations() = -1 And WindowPane() = 3 Then
    GoToAnnotationScope
    If SelType() = 2 Then
        EditCopy
    Else
        MsgBox "No text to select."
    End If
    OtherPane
Else
    MsgBox "Please place the insertion point in an annotation."
End If

See Also

GoToNextItem, GoToPreviousItem, OtherPane, ViewAnnotations(), WindowPane()