Shape.SetShapesDefaultProperties 方法 (Excel)

會將指定之圖案的格式設定,指定為圖案的預設格式設定。

語法

運算式SetShapesDefaultProperties

表達 代表 Shape 物件的變數。

範例

這個範例會在 myDocument 中新增一個矩形、設定矩形的填滿格式、將矩形的格式設定為預設的圖案格式,然後在文件中新增另一個較小的矩形。 第二個矩形的填滿格式與第一個矩形的相同。

Set myDocument = Worksheets(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 
 ' Set formatting as default formatting 
 .SetShapesDefaultProperties 
 End With 
 ' Create new shape with default formatting 
 .AddShape msoShapeRectangle, 90, 90, 40, 30 
End With

支援和意見反應

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