Skip to content

Latest commit

 

History

History
55 lines (38 loc) · 1.53 KB

Publisher.MailMergeDataField.Parent.md

File metadata and controls

55 lines (38 loc) · 1.53 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
MailMergeDataField.Parent property (Publisher)
vbapb10.chm6422531
vbapb10.chm6422531
Publisher.MailMergeDataField.Parent
cca35fe6-b959-0cfe-85de-347db2655c38
06/11/2019
medium

MailMergeDataField.Parent property (Publisher)

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.

Syntax

expression.Parent

expression A variable that represents a MailMergeDataField object.

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

[!includeSupport and feedback]