WPS 基础接口 > 演示 API 参考 > TextRange > 方法 > TextRange.InsertAfter 方法
在指定文本范围的末尾添加一个字符串。返回一个代表添加文本的 TextRange 对象。省略参数时,该方法返回一个在指定范围末尾的长度为零的字符串。

语法

表达式.InsertAfter(NewText)

表达式   一个代表 TextRange 对象的变量。

参数

名称 必选/可选 数据类型 描述
NewText 可选 String 要插入的文字。默认值为一个空字符串。

示例

本示例将字符串“: Test version”追加到活动演示文稿第一张幻灯片标题的末尾。

示例代码
let myShape = Application.ActivePresentation.Slides.Item(1).Shapes.Item(1)
myShape.TextFrame.TextRange.InsertAfter(": Test version")

本示例将剪贴板的内容追加到第一张幻灯片标题的末尾。

示例代码
Application.ActivePresentation.Slides.Item(1).Shapes.Item(1).TextFrame.TextRange.InsertAfter().Paste()

insertafter 方法 insertafter 方法 在后面插入


请参阅