Publisher) (RulerGuides.Parent 屬性

會傳回代表所指定物件之父物件的物件。 例如,若為 TextFrame 物件,會傳回代表文字框之父圖形的 Shape 物件。 唯讀。

語法

運算式父母

表達 代表 RulerGuides 物件的變數。

範例

本範例存取選取圖案的父物件,然後將新圖案加入其中,再設定新圖案的填滿。

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

本範例會先傳回文字框的父物件,也就是使用中出版物的第一個圖案,然後使用圖樣來填滿圖案。

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

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應