BorderArt Object (Publisher)

Office 2013 and later

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

Represents an available type of BorderArt. BorderArt is picture borders that can be applied to text boxes, picture frames, or rectangles. The BorderArt object is a member of the BorderArts collection. The BorderArts collection contains all BorderArt available for use in the specified publication.

The BorderArts collection includes any custom BorderArt types created by the user for the specified publication.

Use the Item property of a BorderArts collection to return a specific BorderArt object. The Index argument of the Item property can be the number or name of the BorderArt object.

This example returns the BorderArt "Apples" from the active publication.

Dim bdaTemp As BorderArt 
Set bdaTemp = ActiveDocument.BorderArts.Item (Index:="Apples") 

Use the Name property to specify which type of BorderArt you want applied to a picture. The following example sets all the BorderArt in a document to the same type using the Name property.

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

Note Note

Because Name is the default property of both the BorderArt object and the BorderArtFormat object, you do not need to state it explicitly when setting the BorderArt type. The statement

Shape.BorderArtFormat = Document.BorderArts(1)

is equivalent to

Shape.BorderArtFormat.Name = Document.BorderArts(1).Name