weijiefg

1,定义网格线种类

$LineStyle = "microsoft.office.interop.excel.xlLineStyle" -as [type]

2,指定网格线种类

$sheet.cells.item(2,3).borders.LineStyle = $LineStyle::xlDashDotDot

        网线种类:

        xlContinuous     实线
   xlDashDot      一点划线
   xlDashDotDot    二点划线
   xlDouble       双线
   xlSlantDashDot    斜线
   xlDash        虚线
   xlLineStyleNone   没有线

3,定义网线的宽度

$Weight = "microsoft.office.interop.excel.xlBorderWeight" -as [type]

4,指定网格线的宽度

$sheet.cells.item(2,3).borders.Weight = $Weight::xlMedium

        网线宽度种类:

        xlHairline    及细
   xlThin        细
   xlMedium    中
   xlThick        粗

5,列宽自动调整
$range = $sheet.usedRange
$range.EntireColumn.AutoFit() | out-null

分类:

技术点:

相关文章:

  • 2022-01-02
  • 2022-02-07
  • 2021-10-21
  • 2022-12-23
  • 2021-08-26
  • 2021-11-18
  • 2021-11-04
  • 2021-06-04
猜你喜欢
  • 2021-09-13
  • 2022-12-23
  • 2021-08-28
  • 2021-12-22
  • 2022-01-24
  • 2022-03-08
相关资源
相似解决方案