我在文档中用录制宏的方法插入了2个表格,但是看那代码都是如下: ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=1, NumColumns:= _ 3, DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:= _ wdAutoFitFixed With Selection.Tables(1) If .Style <> "网格型" Then .Style = "网格型" End If .ApplyStyleHeadingRows = True .ApplyStyleLastRow = True .ApplyStyleFirstColumn = True .ApplyStyleLastColumn = True End With Selection.EndKey Unit:=wdStory Selection.TypeParagraph ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=1, NumColumns:= _ 2, DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:= _ wdAutoFitFixed With Selection.Tables(1) If .Style <> "网格型" Then .Style = "网格型" End If .ApplyStyleHeadingRows = True .ApplyStyleLastRow = True .ApplyStyleFirstColumn = True .ApplyStyleLastColumn = True End With 为什么两个表格都是Tables(1)呢? 我如何向每个表格的列中插入文字呢?(VBA实现)
flPSJ0B0.rar
(2.17 KB, 下载次数: 8)
|