下面是操作word,excel的差不多,但excel没有设置磅数
- Sub Bd()
- Dim i&
- With ActiveDocument.Tables(1) '表格1
- .Borders(wdBorderTop).LineStyle = 1 '表格添加上边框
- .Borders(wdBorderTop).LineWidth = wdLineWidth150pt '磅数为1.5
- .Borders(wdBorderBottom).LineStyle = 1 '表格添加下边框
- .Borders(wdBorderBottom).LineWidth = wdLineWidth150pt '磅数为1.5
- .Rows(2).Cells.Borders(wdBorderTop).LineStyle = 1 '第2行表格添加上边框
- .Rows(2).Cells.Borders(wdBorderTop).LineWidth = wdLineWidth075pt '磅数为0.75
- For i = 4 To .Rows.Count Step 2
- With .Rows(i).Cells.Borders(wdBorderTop)
- .LineStyle = 1 '第i行添加上边框
- .LineWidth = wdLineWidth050pt '磅数为0.5
- End With
- Next
- End With
- End Sub


雷达卡



京公网安备 11010802022788号







