TextFrame.ValidLinkTarget 方法 (Publisher)

Determines whether the text frame of one shape can be linked to the text frame of another shape.

如果 LinkTarget 是有效目标,则返回 True。 如果 LinkTarget 已包含文本或已链接,或者形状不支持附加文本,则返回 False

语法

表达式ValidLinkTarget (LinkTarget)

表达 一个代表 TextFrame 对象的变量。

参数

名称 必需/可选 数据类型 说明
LinkTarget 必需 Shape 要链接到表达式返回的文本框架的目标文本框架的形状。

返回值

布尔值

示例

本示例检查当前出版物的第一页上的第一个和第二个形状的文字框架是否可以相互链接。 如果可以,本示例将链接这两个文字框架。

Dim txtFrame1 As TextFrame 
Dim txtFrame2 As TextFrame 
 
With ActiveDocument.Pages(1) 
 Set txtFrame1 = .Shapes(1).TextFrame 
 Set txtFrame2 = .Shapes(2).TextFrame 
End With 
 
If txtFrame1.ValidLinkTarget(LinkTarget:=txtFrame2.Parent) = True Then 
 txtFrame1.NextLinkedTextFrame = txtFrame2 
End If

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。