Shape.ParentGroupShape 属性 (Publisher)

返回一个 Shape 对象,该对象代表子形状或子形状范围的通用父形状。

语法

表达式ParentGroupShape

表达 一个代表 Shape 对象的变量。

返回值

型号

示例

本示例在当前文档中创建两个形状,并将其组合。 使用组中的一个形状,它将访问父组,并使用相同的填充图案填充父组中的所有形状。 本示例假定当前文档目前不包含任何形状。 如果当前文档包含形状,可能会出现错误。

Sub ParentGroupShape() 
 Dim shpGroup As Shape 
 
 With ActiveDocument.Pages(1).Shapes 
 .AddShape Type:=msoShapeOval, Left:=72, _ 
 Top:=72, Width:=100, Height:=100 
 .AddShape Type:=msoShapeHeart, Left:=110, _ 
 Top:=120, Width:=100, Height:=100 
 .Range(Array(1, 2)).Group 
 End With 
 
 Set shpGroup = ActiveDocument.Pages(1).Shapes(1) _ 
 .GroupItems(1).ParentGroupShape 
 shpGroup.Fill.Patterned Pattern:=msoPattern25Percent 
 
End Sub

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。