AttachedToText Property

Microsoft Publisher Visual Basic

expression.AttachedToText

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

Example

This example duplicates the font formatting; then it checks to see if the duplicated formatting is attached to a text range and if it is not, it attaches the formatting to the second shape.

Sub DuplicateText()
    Dim fntTemp As Font
    With ActiveDocument.Pages(1)
        Set fntTemp = .Shapes(1).TextFrame.TextRange.Font.Duplicate
        If fntTemp.AttachedToText <> True Then _
            ActiveDocument.Pages(1).Shapes(2) _
            .TextFrame.TextRange.Font = fntTemp
    End With
End Sub