Share via


BorderArt Object

Publisher Developer Reference

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.

Remarks

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

Example

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.

Visual Basic for Applications
  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.

Visual Basic for Applications
  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

Aa436353.vs_note(en-us,office.12).gif  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
Visual Basic for Applications
  Shape.BorderArtFormat = Document.BorderArts(1)
is equivalent to
Visual Basic for Applications
  Shape.BorderArtFormat.Name = Document.BorderArts(1).Name
.
Visual Basic for Applications
  Shape.BorderArtFormat = Document.BorderArts(1)
Visual Basic for Applications
  Shape.BorderArtFormat.Name = Document.BorderArts(1).Name

See Also