TextSelection.EndOfDocument(Boolean) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
将对象移动到文档末尾。
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
注解
如果 Extend 为 true ,则仅移动文本选定内容的活动端。 否则,文本选择将折叠并置于文档末尾。