會將文件的預設圖案格式套用至指定的圖案。
語法
表情。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
另請參閱
支援和意見反應
有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應。