word 解放双手,使用宏批量添加word中表格边框以及自适应

Sub 宏2()
'
' 宏2 宏
'
'
For Each aTable In ActiveDocument.Tables
    With aTable
        aTable.Select
        With .Borders(wdBorderLeft)
           .LineStyle = wdLineStyleSingle
          .LineWidth = wdLineWidth050pt
          .Color = wdColorAutomatic
        End With
        With .Borders(wdBorderRight)
          .LineStyle = wdLineStyleSingle
          .LineWidth = wdLineWidth050pt
          .Color = wdColorAutomatic
        End With
        With .Borders(wdBorderTop)
          .LineStyle = wdLineStyleSingle
          .LineWidth = wdLineWidth050pt
          .Color = wdColorAutomatic
        End With
        With .Borders(wdBorderBottom)
          .LineStyle = wdLineStyleSingle
          .LineWidth = wdLineWidth050pt
          .Color = wdColorAutomatic
        End With
        With .Borders(wdBorderHorizontal)
         .LineStyle = wdLineStyleSingle
         .LineWidth = wdLine

你可能感兴趣的:(word,宏,wordnet)