多种对象![]() |
代表一个对象的边框。Border 对象是 Borders 集合中的元素。
用 Borders(index) 可返回单个 Border 对象,其中 index 用来标识边框。索引序号可以是下列 WdBorderType 常量之一:wdBorderBottom、wdBorderHorizontal、wdBorderLeft、wdBorderRight、wdBorderTop 或 wdBorderVertical。可用 LineStyle 属性设置 Border 对象的边框线段。下列示例在活动文档首段的底端添加一个双线边框。
With ActiveDocument.Paragraphs(1).Borders(wdBorderBottom)
.LineStyle = wdLineStyleDouble
.LineWidth = wdLineWidth025pt
End With
下列示例将单线边框加在选定内容的首字符四周。
With Selection.Characters(1)
.Font.Size = 36
.Borders.Enable = True
End With
下列示例在每页第一节的四周添加艺术型边框。
For Each aBorder In ActiveDocument.Sections(1).Borders
With aBorder
.ArtStyle = wdArtSeattle
.ArtWidth = 20
End With
Next aBorder
不能在 Borders 集合中添加 Border 对象。在 Borders 集合中元素的数量是有限制的,并且因对象的类型不同而异。例如,在 Borders 集合中,表格有六个元素,而段落有四个元素。