TextFrame.ValidLinkTarget method (Word)

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

Syntax

expression. ValidLinkTarget( _TargetTextFrame_ )

expression Required. A variable that represents a TextFrame object.

Parameters

Name Required/Optional Data type Description
TargetTextFrame Required TextFrame The target text frame to which you want to link the text frame returned by expression.

Return value

Boolean

Remarks

This method returns True if TargetTextFrame is a valid target and returns False if TargetTextFrame already contains text, is already linked, or if the shape doesn't support attached text.

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

See also

TextFrame Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.