Share via


Borders.ApplyPageBordersToAllSections Method (Word)

Applies the specified page-border formatting to all sections in a document.

Syntax

expression .ApplyPageBordersToAllSections

expression Required. A variable that represents a Borders collection.

Example

This example adds a single-line page border to all sections in the active document.

Dim borderLoop As Border 
 
With ActiveDocument.Sections(1) 
 For Each borderLoop In .Borders 
 With borderLoop 
 .LineStyle = wdLineStyleSingle 
 .LineWidth = wdLineWidth050pt 
 End With 
 Next borderLoop 
 .Borders.ApplyPageBordersToAllSections 
End With

See Also

Concepts

Borders Collection Object

Borders Object Members