Table of contents
TOC
折叠目录
展开目录

TextRange.Select 方法 (发布服务器)TextRange.Select Method (Publisher)

office 365 dev account|上次更新日期: 2018/3/13
|
2 参与人员

选择指定的对象。Selects the specified object.

语法Syntax

表达式选择expression. Select

_expression_A 变量,表示内容的TextRange对象。_expression_A variable that represents a TextRange object.

示例Example

本示例从已添加到活动出版物的第一页上的表格中选择左上角的单元格。This example selects the upper-left cell from a table that has been added to the first page in the active publication.

Dim shpTable As Shape 
Dim cllTemp As Cell 

With ActiveDocument.Pages(1).Shapes 
 Set shpTable = .AddTable(NumRows:=3, NumColumns:=3, _ 
 Left:=100, Top:=100, Width:=150, Height:=150) 
 Set cllTemp = shpTable.Table.Cells.Item(1) 
 cllTemp.Select 
End With

本示例从已添加到活动出版物的第一页上的表格中选择第一列。This example selects the first column from a table that has been added to the first page in the active publication.

Dim shpTable As Shape 
Dim crTemp As CellRange 

With ActiveDocument.Pages(1).Shapes 
 Set shpTable = .AddTable(NumRows:=3, NumColumns:=3, _ 
 Left:=100, Top:=100, Width:=150, Height:=150) 
 Set crTemp = shpTable.Table.Cells(StartRow:=1, _ 
 StartColumn:=1, EndRow:=3, EndColumn:=1) 
 crTemp.Select 
End With

本示例选择活动出版物的第一页上的第一个形状中的前五个字符。This example selects the first five characters in shape one on page one of the active publication.

ActiveDocument.Pages(1).Shapes(1).TextFrame _ 
 .TextRange.Characters(1, 5).Select
© 2018 Microsoft