ShapeRange.SetShapesDefaultProperties 方法 (PowerPoint)
會將指定圖案的格式設定套用到預設圖案。 如果是使用這個方法之後才建立的圖案,預設會套用這項格式設定。
語法
運算式。SetShapesDefaultProperties
表達 代表 ShapeRange 物件的 變數。
範例
在這個範例中,會將矩形新增至 myDocument,設定此矩形的填滿格式,將此矩形的格式設定套用到預設圖案,然後再將一個較小的矩形新增至文件。 第二個矩形的填滿格式與第一個矩形的相同。
Set mydocument = ActivePresentation.Slides(1)
With mydocument.Shapes
With .AddShape(msoShapeRectangle, 5, 5, 80, 60)
With .Fill
.ForeColor.RGB = RGB(0, 0, 255)
.BackColor.RGB = RGB(0, 204, 255)
.Patterned msoPatternHorizontalBrick
End With
' Sets formatting for default shapes
.SetShapesDefaultProperties
End With
' New shape has default formatting
.AddShape msoShapeRectangle, 90, 90, 40, 30
End With
另請參閱
支援和意見反應
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。