码迷,mamicode.com
首页 > 其他好文 > 详细

批量修改WORD表格属性

时间:2014-08-12 12:59:04      阅读:383      评论:0      收藏:0      [点我收藏+]

标签:blog   os   io   for   cti   div   log   ad   

有时候需要对word中很多表格的属性进行修改,而word无法批量修改属性,所有这里记录一个宏

Sub TableFormatter()
Dim oTbl As Table, i As Integer
For Each oTbl In Selection.Tables
  With oTbl
    .Rows.AllowBreakAcrossPages = False
    .Rows(1).HeadingFormat = True
    For i = 1 To .Columns.Count
      If i = 1 Then .Columns(i).Width = InchesToPoints(1.19)
      If i = 2 Then .Columns(i).Width = InchesToPoints(2#)
      If i = 3 Then .Columns(i).Width = InchesToPoints(1.19)
      If i = 4 Then .Columns(i).Width = InchesToPoints(2#)
      If i = 5 Then .Columns(i).Width = InchesToPoints(2.62)
    Next
  End With
Next
End Sub

  

批量修改WORD表格属性,布布扣,bubuko.com

批量修改WORD表格属性

标签:blog   os   io   for   cti   div   log   ad   

原文地址:http://www.cnblogs.com/asyuras/p/3906630.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!