Borders 属性

       

该属性返回一个 Borders 集合,该集合代表指定对象的所有边框。

expression.Borders

expression   必需。该表达式返回“应用于”列表中的一个对象。

说明

有关返回集合中单独成员的信息,请参阅返回集合中的对象

示例

本示例对活动文档中的第一个表格应用内部和外部边框。

Set myTable = ActiveDocument.Tables(1)
With myTable.Borders
    .InsideLineStyle = wdLineStyleSingle
    .OutsideLineStyle = wdLineStyleDouble
End With

本示例对所选内容中第一个字符应用边框。如果没有选定内容,则对插入点后的第一个字符应用边框。

Selection.Characters(1).Borders.Enable = True

本示例在活动文档中的所有居中段落底部应用下边框。

For Each para In ActiveDocument.Paragraphs
    If para.Alignment = wdAlignParagraphCenter Then
        para.Borders(wdBorderBottom).LineStyle = wdLineStyleSingle
        para.Borders(wdBorderBottom).LineWidth = wdLineWidth300pt
    End If
Next para

本示例为当前节中的所有页面添加边框。

For Each aBorder In Selection.Sections(1).Borders
    aBorder.ArtStyle = wdArtBasicBlackDots
    aBorder.ArtWidth = 6
Next aBorder