共用方式為


Borders.ApplyPageBordersToAllSections Method

Word Developer Reference

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.

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