Share via


ContainingObject Property [Publisher 2003 VBA Language Reference]

Returns an Object that represents the object that contains the text range. Read-only.

expression.ContainingObject

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

Example

This example returns the name of the object containing the specified text range.

Sub NameOfContainingObject()
    With ActiveDocument.Pages(1).Shapes(1).TextFrame _
            .TextRange.ContainingObject
        MsgBox The name of the object containing the text is " & .Name
    End With
End Sub

Applies to | TextRange Object