ValidLinkTarget Method

Microsoft Publisher Visual Basic

expression.ValidLinkTarget(LinkTarget)

expression    Required. An expression that returns one of the objects in the Applies To list.

LinkTarget   Required Shape object. The shape with the target text frame to which you wish to link the text frame returned by expression   .

Example

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

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