ValidLinkTarget 方法

       

确定某图形的文本框是否能链接另一个图形的文本框。如果 TargetTextFrame 是一个有效对象,则返回 True。如果 TargetTextFrame 已有正文或已链接,或者图形不支持附加文字,则返回 False

expression.ValidLinkTarget(TargetTextFrame)

expression   必需。返回 TextFrame 对象的表达式。

TargetTextFrame   TextFrame 对象,必需。与 expression 返回的文本框相链接的目标文本框。

示例

本示例实现的功能是:检查活动文档第一和第二个图形的文本框,以判断其是否能相互链接。如果能,则链接两个文本框。

Dim textFrame1 As TextFrame
Dim textFrame2 As TextFrame

Set textFrame1 = ActiveDocument.Shapes(1).TextFrame
Set textFrame2 = ActiveDocument.Shapes(2).TextFrame
If textFrame1.ValidLinkTarget(textFrame2) = True Then
    textFrame1.Next = textFrame2
End If