Range.BorderAround(Object, XlBorderWeight, XlColorIndex, Object) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
public object BorderAround (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);
Public Function BorderAround (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) As Object
参数
- LineStyle
- Object
可选 XlLineStyle。 边框的线条样式。 可以是以下 XlLineStyle 常量之一:xlContinuousdefault
xlDashxlDashDotxlDashDotxlDotxlDot xlDoublexlLineStlyeNonexlSlantDashDotxlLineStlyeNone
- Weight
- XlBorderWeight
可选 XlBorderWeight。 边框粗细。 可以是以下 XlBorderWeight 常量之一:xlHairlinexlMediumxlThickxlThindefault
- ColorIndex
- XlColorIndex
可选 XlColorIndex。 边框颜色,作为当前调色板的索引或作为 XlColorIndex 常量。 可以是以下 XlColorIndex 常量之一:xlColorIndexAutomaticdefault
xlColorIndexNone
- Color
- Object
可选 对象。 边框颜色,以 RGB 值表示。
返回
注解
必须指定 或 Color
,但不能同时指定ColorIndex
两者。
可以指定 或 Weight
,但不能同时指定LineStyle
两者。 如果未指定任何参数,Microsoft Excel 将使用默认的线型和粗细。
此方法概述整个区域,而不进行填充。 若要设置所有单元格的边框,必须设置 ColorBorders 集合的 、 LineStyle和 Weight 属性。 若要清除边框,必须将区域中的所有单元格的 LineStyle 属性设置为 xlLineStyleNone。