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

TextRange2.Lines 属性 (PowerPoint)TextRange2.Lines Property (PowerPoint)

office 365 dev account|上次更新日期: 2017/9/25
|
1 参与者

返回一个代表指定文本行子集的 TextRange2 对象。只读。Returns a TextRange2 object that represents the specified subset of text lines. Read-only.

语法Syntax

表达式线条开始长度expression. Lines( Start, Length )

表达式_该表达式返回的TextRange2对象。_expression An expression that returns a TextRange2 object.

参数Parameters

名称Name必需/可选Required/Optional数据类型Data Type说明Description
StartStart可选OptionalLongLong返回的范围中的第一行。The first line in the returned range.
长度Length可选OptionalLongLong要返回的行数。The number of lines to be returned.

返回值Return Value

TextRange2TextRange2

注解Remarks

如果开始位置和长度都被省略,则返回的范围从第一行开始,并指定范围中的最后一段结束。If both Start and Length are omitted, the returned range starts with the first line and ends with the last paragraph in the specified range.

如果指定启动,但未指定长度,则返回的范围包含一行。If Start is specified but Length is omitted, the returned range contains one line.

如果指定 Length 但省略 Start,则返回的范围从指定范围中的第一行开始。If Length is specified but Start is omitted, the returned range starts with the first line in the specified range.

如果 Start 大于指定文本中的行数,则返回的范围从指定范围中的最后一行开始。If Start is greater than the number of lines in the specified text, the returned range starts with the last line in the specified range.

如果 Length 参数大于从指定起始行到末尾的文本行数,则返回的范围包含所有这些行。If Length is greater than the number of lines from the specified starting line to the end of the text, the returned range contains all those lines.

示例Example

以下示例将当前的 PowerPoint 演文示稿中第一张幻灯片上第二个形状中第二段的前两行设为斜体。This example formats as italic the first two lines of the second paragraph in shape two on slide one in the active PowerPoint presentation.

Application.ActivePresentation.Slides(1).Shapes(2) _ 
 .TextFrame.TextRange2.Paragraphs(2) _ 
 .Lines(1, 2).Font.Italic = True 

另请参阅See also

概念Concepts

TextRange2 对象 (PowerPoint)TextRange2 Object (PowerPoint)

© 2018 Microsoft