Enable related procedures in class Border (Word VBA)

This page presents procedures from class Border related to the theme Enable: Borders.Enable, Borders.EnableFirstPageInSection and Borders.EnableOtherPagesInSection

Borders.Enable

Returns or sets border formatting for the specified object.

The Enable property returns True or wdUndefined if border formatting is applied to all or part of the specified object. Can be set to True, False, or a WdLineStyle constant. The Enable property applies to all borders for the specified object. True sets the line style to the default line style and sets the line width to the default line width. The default line style and line width can be set using the DefaultBorderLineWidth and DefaultBorderLineStyle properties. To remove all the borders from an object, set the Enable property to False, as shown in the following example.

ActiveDocument.Tables(1).Borders.Enable = False

Borders.EnableFirstPageInSection

True if page borders are enabled for the first page in the section.

Dim borderLoop As Border 
 
With Selection.Sections(1) 
 .Borders.EnableFirstPageInSection = True 
 .Borders.EnableOtherPagesInSection = False 
 For Each borderLoop In .Borders 
 borderLoop.ArtStyle = wdArtPeople 
 borderLoop.ArtWidth = 15 
 Next borderLoop 
End With

Borders.EnableOtherPagesInSection

True if page borders are enabled for all pages in the section except for the first page.

Dim borderLoop As Border 
 
With Selection.Sections(1) 
 .Borders.EnableFirstPageInSection = False 
 .Borders.EnableOtherPagesInSection = True 
 For Each borderLoop In .Borders 
 borderLoop.ArtStyle = wdArtBabyRattle 
 borderLoop.ArtWidth = 22 
 Next borderLoop 
End With