ValidLinkTarget Method

Microsoft Word Visual Basic

Determines whether the text frame of one shape can be linked to the text frame of another shape. Returns True if TargetTextFrame is a valid target. Returns False if TargetTextFrame already contains text or is already linked, or if the shape doesn't support attached text.

expression.ValidLinkTarget(TargetTextFrame)

expression    Required. An expression that returns a TextFrame object.

TargetTextFrame    Required TextFrame object. The target text frame that you'd like to link the text frame returned by expression    to.

Example

This example checks to see whether the text frames for the first and second shapes in the active document can be linked to one another. If so, the example links the two text frames.

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