Border 对象 (Word)Border object (Word)

代表对象的边框。Represents a border of an object. Border对象是**边框** 集合的成员。The Border object is a member of the Borders collection.

说明Remarks

使用边框(索引), 其中索引标识边框, 返回单个边框对象。Use Borders (index), where index identifies the border, to return a single Border object. 索引可以是 WdBorderType 常量之一。Index can be one of the WdBorderType constants. 一些 WdBorderType 常量可能不可用,这取决于您所选择或安装的语言支持 (例如美国英语)。Some of the WdBorderType constants may not be available to you, depending on the language support (U.S. English, for example) that you have selected or installed.

使用**LineStyle** 属性可对border对象应用边框线。Use the LineStyle property to apply a border line to a Border object. 下列示例在活动文档中第一段下方的双线边框。The following example applies a double-line border below the first paragraph in the active document.

With ActiveDocument.Paragraphs(1).Borders(wdBorderBottom) 
 .LineStyle = wdLineStyleDouble 
 .LineWidth = wdLineWidth025pt 
End With

以下示例将单线边框加在选定内容的首字符四周。The following example applies a single-line border around the first character in the selection.

With Selection.Characters(1) 
 .Font.Size = 36 
 .Borders.Enable = True 
End With

以下示例在第一节中每一页的四周添加艺术型边框。The following example adds an art border around each page in the first section.

For Each aBorder In ActiveDocument.Sections(1).Borders 
 With aBorder 
 .ArtStyle = wdArtSeattle 
 .ArtWidth = 20 
 End With 
Next aBorder

Border 对象不能添加到 边框 集合。Border objects cannot be added to the Borders collection. Borders 集合,集合中的成员数目是有限的并取决于对象的类型。The number of members in the Borders collection is finite and varies depending on the type of object. 例如,表具有六个元素在 边框 集合中,而一个段落有四个。For example, a table has six elements in the Borders collection, whereas a paragraph has four.

属性Properties

另请参阅See also

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.