Parent Property

Microsoft Word Visual Basic

Parent Property

       

For the TextFrame object, returns a Shape object representing the parent shape of the text frame. For all other objects, returns an object that represents the parent object of the specified object.

expression.Parent

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

Example

This example sets a variable to the parent object of the Bookmarks object and displays a message box with the object type name of the variable.

Set myObject = ActiveDocument.Bookmarks.Parent
MsgBox TypeName(myObject)

This example sets a variable to the first cell in the first table of the active document, changes the width of the cell to 36 points, and removes borders from the table.

Set myRange = ActiveDocument.Tables(1).Cell(1, 1)
With myRange
    .SetWidth ColumnWidth:=36, RulerStyle:=wdAdjustNone
    .Parent.Borders.Enable = False
End With