Share via


NamedRange.BorderAround2 方法

定义

NamedRange 控件添加一个边框,并设置新边框的 ColorLineStyleWeight 属性。

public object BorderAround2 (object LineStyle, Microsoft.Office.Interop.Excel.XlBorderWeight Weight = Microsoft.Office.Interop.Excel.XlBorderWeight.xlThin, Microsoft.Office.Interop.Excel.XlColorIndex ColorIndex = Microsoft.Office.Interop.Excel.XlColorIndex.xlColorIndexAutomatic, object Color, object ThemeColor);
abstract member BorderAround2 : obj * Microsoft.Office.Interop.Excel.XlBorderWeight * Microsoft.Office.Interop.Excel.XlColorIndex * obj * obj -> obj
Public Function BorderAround2 (Optional LineStyle As Object, Optional Weight As XlBorderWeight = Microsoft.Office.Interop.Excel.XlBorderWeight.xlThin, Optional ColorIndex As XlColorIndex = Microsoft.Office.Interop.Excel.XlColorIndex.xlColorIndexAutomatic, Optional Color As Object, Optional ThemeColor As Object) As Object

参数

Weight
XlBorderWeight

边框的粗细。 可以是以下 XlBorderWeight 常量之一: xlHairlinexlMediumxlThickxlThin

ColorIndex
XlColorIndex

边框颜色(作为访问当前调色板的索引或作为 XlColorIndex 常数)。 可以是以下 XlColorIndex 常量之一: xlColorIndexAutomaticxlColorIndexNone

Color
Object

边框颜色,采用 RGB 值的形式。

ThemeColor
Object

主题颜色(作为访问当前颜色主题的索引或作为 XlThemeColor 值)。

返回

注解

必须指定 或 Color,但不能同时指定ColorIndex两者。

可以指定 或 Weight,但不能同时指定LineStyle两者。 如果未指定任一参数,Microsoft Office Excel 将使用默认线条样式和粗细。

此方法勾勒出整个范围而不填充它。 若要设置所有单元格的边框,必须设置集合的 ColorBordersLineStyleWeight 属性。 若要清除边框,必须将该区域中的所有单元格的 属性xlLineStyleNone设置为 LineStyle

适用于