Sunday, November 22, 2015

Copying All Tables to a New Document

Sub CopyTables ( ) 
Dim Source As Document 
Dim Target As Document
Dim tbl As Table 
Dim tr As Range
Set Source = ActiveDocument
Set Target = Documents.Add
For Each tbl In Source.Tables
 Set tr = Target.Range
 tr.Collapse wdCollapseEnd
 tr.FormattedText = tbl.Range.FormattedText
 tr.Collapse wdCollapseEnd
 tr.Text = vbCrLf 
 Next 
End Sub
Give it a try when you can.


Highly Recommended:
Basic - Advanced MS Word Legal Training.

Expert Hands-On Test Prep

No comments:

Post a Comment