Shape.SetShapesDefaultProperties 方法 (Word)

會將文件的預設圖案格式套用至指定的圖案。

語法

運算式SetShapesDefaultProperties

需要 expression。 代表 Shape 物件的變數。

註解

新圖案會繼承預設圖案的許多屬性。

範例

本範例會將矩形新增至 myDocument 、格式化矩形的填滿、將矩形的格式設定套用至預設圖案,然後將另一個較小的 () 矩形新增至檔。 第二個矩形的填滿格式與第一個矩形的相同。

Set mydocument = ActiveDocument 
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

另請參閱

Shape 物件

支援和意見反應

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