Share via


Parent Property [Publisher 2003 VBA Language Reference]

Returns an object that represents the parent object of the specified object. For example, for a TextFrame object, returns a Shape object representing the parent shape of the text frame. Read-only.

expression.Parent

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

Example

This example accesses the parent object of the selected shape, and then adds a new shape to it and sets the fill for the new shape.

Sub ParentObject()
    Dim shp As Shape
    Dim pg As Page

    Set pg = Selection.ShapeRange(1).Parent
    Set shp = pg.Shapes.AddShape(Type:=msoShape5pointStar, _
        Left:=72, Top:=72, Width:=72, Height:=72)

    shp.Fill.ForeColor.RGB = RGB(Red:=180, Green:=180, Blue:=180)
End Sub

This example returns the parent object of a text frame, which is the first shape in the active publication, and then fills the shape with a pattern.

Sub ParentShape()
    Dim shpParent As Shape
    Set shpParent = ActiveDocument.Pages(1).Shapes(1).TextFrame.Parent
    shpParent.Fill.Patterned Pattern:=msoPatternSphere
End Sub

Applies to | Adjustments Object | AdvancedPrintOptions Object | Application Object | BorderArt Object | BorderArtFormat Object | BorderArts Collection | CalloutFormat Object | CatalogMergeShapes Collection | Cell Object | CellBorder Object | CellRange Collection | ColorCMYK Object | ColorFormat Object | ColorScheme Object | ColorSchemes Collection | ColorsInUse Collection | Column Object | Columns Collection | ConnectorFormat Object | Document Object | Documents Collection | DropCap Object | Field Object | Fields Collection | FillFormat Object | FindReplace Object | Font Object | FreeformBuilder Object | GroupShapes Collection | HeaderFooter Object | Hyperlink Object | Hyperlinks Collection | InlineShapes Collection | Label Object | Labels Collection | LayoutGuides Object | LineFormat Object | LinkFormat Object | MailMerge Object | MailMergeDataField Object | MailMergeDataFields Collection | MailMergeDataSource Object | MailMergeFilterCriterion Object | MailMergeFilters Collection | MailMergeMappedDataField Object | MailMergeMappedDataFields Collection | MasterPages Collection | ObjectVerbs Collection | OLEFormat Object | Options Object | Page Object | PageBackground Object | Pages Collection | PageSetup Object | ParagraphFormat Object | PhoneticGuide Object | PictureFormat Object | Plate Object | Plates Collection | PrintablePlate Object | PrintablePlates Collection | PrintableRect Object | ReaderSpread Object | Row Object | Rows Collection | RulerGuide Object | RulerGuides Collection | ScratchArea Object | Section Object | Sections Collection | Selection Object | ShadowFormat Object | Shape Object | ShapeNode Object | ShapeNodes Collection | ShapeRange Collection | Shapes Collection | Stories Collection | Story Object | Table Object | TabStop Object | TabStops Collection | Tag Object | Tags Collection | TextEffectFormat Object | TextFrame Object | TextRange Object | TextStyle Object | TextStyles Collection | ThreeDFormat Object | View Object | WebCheckBox Object | WebCommandButton Object | WebHiddenFields Collection | WebListBox Object | WebListBoxItems Object | WebNavigationBarHyperlinks Object | WebNavigationBarSet Object | WebNavigationBarSets Collection | WebOptionButton Object | WebOptions Object | WebPageOptions Object | WebTextBox Object | Window Object | Wizard Object | WizardProperties Collection | WizardProperty Object | WizardValue Object | WizardValues Collection | WrapFormat Object