WORD批量加入报表标题(转载)

WORD批量加入表格标题(转载)Sub macro1()If ActiveDocument.Tables.Count 1 ThenSet act_Doc Activ

WORD批量加入表格标题(转载)
Sub macro1()
'
'
If ActiveDocument.Tables.Count >= 1 Then
   Set act_Doc = ActiveDocument
       For Each otable In act_Doc.Tables
            CaptionLabels.Add Name:="表格"
       With otable.Range.InsertCaption(Label:="表格", Position:=wdCaptionPositionAbove)
           'Position:=wdCaptionPositionBelow
       End With
    Next
End If

End Sub