Share via


AttachedToText Property [Publisher 2003 VBA Language Reference]

True if the Font or ParagraphFormat object is attached to a TextRange object. If the object is attached to a TextRange object, the document will be updated when properties of the object are changed. If the object is not attached, nothing in the document will be changed until the object is applied to a TextRange or Style object. Read-only Boolean.

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

Applies to | Font Object | ParagraphFormat Object