A
avkokin
Hello.
There is one document which has some tables. I need to copy every
table from this document into separate files. Every files will has
only one table. I tried use next macro (thank's Helmut Weber), but I
get only values from table, not type of table. Help me, please.
Sub Test0031()
Dim iDoc As Integer ' number of dcouments
Dim dDc1 As Document ' active document
Dim dDc2 As Document ' new document
Dim rTmp As Range ' temporary range
Set dDc1 = ActiveDocument
For iDoc = 1 To ActiveDocument.Tables.Count
Set rTmp = ActiveDocument.Tables(iDoc).Range
Set dDc2 = Documents.Add(Visible:=False)
dDc2.Range = rTmp
dDc2.SaveAs "c:\test\" & Format(iDoc, "000") & ".doc"
dDc2.Close
Next
Set dDc1 = Nothing
Set dDc2 = Nothing
End Sub
There is one document which has some tables. I need to copy every
table from this document into separate files. Every files will has
only one table. I tried use next macro (thank's Helmut Weber), but I
get only values from table, not type of table. Help me, please.
Sub Test0031()
Dim iDoc As Integer ' number of dcouments
Dim dDc1 As Document ' active document
Dim dDc2 As Document ' new document
Dim rTmp As Range ' temporary range
Set dDc1 = ActiveDocument
For iDoc = 1 To ActiveDocument.Tables.Count
Set rTmp = ActiveDocument.Tables(iDoc).Range
Set dDc2 = Documents.Add(Visible:=False)
dDc2.Range = rTmp
dDc2.SaveAs "c:\test\" & Format(iDoc, "000") & ".doc"
dDc2.Close
Next
Set dDc1 = Nothing
Set dDc2 = Nothing
End Sub