代表应用于指定形状的艺术型边框的格式。
备注
艺术型边框是可以应用于文本框、图片框架或矩形的图片边框。
使用形状的 艺术型边框 属性返回一个 BorderArtFormat 对象。
使用 Set 方法可指定要应用于图片的艺术型边框的类型。
您可以使用 Name 属性可以指定应用于图片的艺术型边框所需的类型。
注意
由于 Name 是 艺术型 Border 和 BorderArtFormat 对象的默认属性,因此在设置艺术型边框类型时无需显式声明它。 语句 Shape.BorderArtFormat = Document.BorderArts(1) 等效 Shape.BorderArtFormat.Name = Document.BorderArts(1).Name于 。
使用 Delete 方法可删除图片中的艺术型边框。
示例
下面的示例返回活动出版物第一页上的第一个形状的艺术型边框,并在消息框中显示艺术型边框的名称。
Dim bdaTemp As BorderArtFormat
Set bdaTemp = ActiveDocument.Pages(1).Shapes(1).BorderArt
MsgBox "BorderArt name is: " &bdaTemp.Name
下面的示例测试活动文档每一页中的各个形状上是否存在艺术型边框。 所有查找到的艺术型边框都将被设置为相同的类型。
Sub SetBorderArt()
Dim anyPage As Page
Dim anyShape As Shape
Dim strBorderArtName As String
strBorderArtName = Document.BorderArts(1).Name
For Each anyPage in ActiveDocument.Pages
For Each anyShape in anyPage.Shapes
With anyShape.BorderArt
If .Exists = True Then
.Set(strBorderArtName)
End If
End With
Next anyShape
Next anyPage
End Sub
以下示例使用 Name 属性将文档中的所有艺术型边框设置为同一类型。
Sub SetBorderArtByName()
Dim anyPage As Page
Dim anyShape As Shape
Dim strBorderArtName As String
strBorderArtName = Document.BorderArts(1).Name
For Each anyPage in ActiveDocument.Pages
For Each anyShape in anyPage.Shapes
With anyShape.BorderArt
If .Exists = True Then
.Name = strBorderArtName
End If
End With
Next anyShape
Next anyPage
End Sub
以下示例判断活动文档每一页中的各个形状上是否存在艺术型边框。 如果存在艺术型边框,则将其删除。
Sub DeleteBorderArt()
Dim anyPage As Page
Dim anyShape As Shape
For Each anyPage in ActiveDocument.Pages
For Each anyShape in anyPage.Shapes
With anyShape.BorderArt
If .Exists = True Then
.Delete
End If
End With
Next anyShape
Next anyPage
End Sub
方法
属性
另请参阅
支持和反馈
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。