次の方法で共有


TextSelection.EndOfDocument メソッド

オブジェクトをドキュメントの末尾に移動します。

名前空間:  EnvDTE
アセンブリ:  EnvDTE (EnvDTE.dll 内)

構文

'宣言
Sub EndOfDocument ( _
    Extend As Boolean _
)
void EndOfDocument(
    bool Extend
)
void EndOfDocument(
    [InAttribute] bool Extend
)
abstract EndOfDocument : 
        Extend:bool -> unit 
function EndOfDocument(
    Extend : boolean
)

パラメーター

  • Extend
    型 : System.Boolean
    省略可能です。移動したテキストの範囲選択を解除するかどうかを指定します。既定値は、false です。

解説

Extend が true の場合は、選択したテキストのアクティブな終点だけが移動します。それ以外の場合は、選択した文字列が折りたたまれてドキュメントの末尾に配置されます。

Sub EndOfDocumentExample()
    ' Before running this example, open a text document.
    Dim objSel As TextSelection = DTE.ActiveDocument.Selection
    Dim objAnchor As VirtualPoint = objSel.AnchorPoint
    ' objAnchor is "live", tied to the position of the actual 
    ' selection, so it will reflect any changes. iCol and iRow are 
    ' created here to save a "snapshot" of the anchor point's position 
    ' at this time.
    Dim iCol As Long = objAnchor.DisplayColumn
    Dim iRow As Long = objAnchor.Line
    ' As the selection is extended, the active point moves but the 
    ' anchor point remains in place.
    objSel.StartOfDocument(True)
    objSel.EndOfDocument(True)

    If (iCol = objAnchor.DisplayColumn And iRow = objAnchor.Line) Then
        MsgBox("The anchor point has remained in place at row " & iRow & ", display column " & iCol)
    End If
End Sub

.NET Framework セキュリティ

  • 直前の呼び出し元に対する完全な信頼。このメンバーは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。

参照

関連項目

TextSelection インターフェイス

EnvDTE 名前空間