ParagraphFormat.AttachedToText property (Publisher)

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 TextStyle object. Read-only Boolean.

Syntax

expression.AttachedToText

expression A variable that represents a ParagraphFormat object.

Example

This example duplicates the font formatting, and then checks to see if the duplicated formatting is attached to a text range. 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

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.