TextSelection.EndOfDocument(Boolean) 方法

定义

将对象移动到文档末尾。

void EndOfDocument(bool Extend = false);
[System.Runtime.InteropServices.DispId(28)]
public void EndOfDocument (bool Extend = false);
[<System.Runtime.InteropServices.DispId(28)>]
abstract member EndOfDocument : bool -> unit
Public Sub EndOfDocument (Optional Extend As Boolean = false)

参数

Extend
Boolean

可选。 确定所移动的文本是否折叠。 默认为 false

属性

示例

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  

注解

如果 Extendtrue ,则仅移动文本选定内容的活动端。 否则,文本选择将折叠并置于文档末尾。

适用于