![]() |
|
#2
|
|||
|
|||
|
Code:
Sub CopyTables()
Dim oDoc As Document
Dim oDocTarget As Document
Dim oTbl As Table, oTblTarget As Table
Dim oRng As Range
Set oDoc = ActiveDocument
Set oDocTarget = Documents.Add
For Each oTbl In oDoc.Tables
Set oRng = oDocTarget.Range
With oRng
.Collapse wdCollapseEnd
oRng.FormattedText = oTbl.Range.FormattedText
Set oTblT = oRng.Tables(1)
oTblT.Style = "Table Grid"
.Collapse wdCollapseEnd
.Text = vbCrLf
End With
Next
oDocTarget.Range.Select
Selection.ClearFormatting
Selection.Collapse wdCollapseStart
oDoc.Activate
lbl_Exit:
Exit Sub
End Sub
|
| Tags |
| strip styles, table styles |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| strip characters from the right | jon.fallows@sedgman.com | Excel | 3 | 05-09-2018 11:38 PM |
Format shelf strip graphic and data
|
ShaunO | Mail Merge | 1 | 08-19-2016 04:20 PM |
Heading row disappears from table styles when pasted table is selected
|
andrewballem | Word Tables | 2 | 11-12-2013 05:18 AM |
strip extra information from email addresses
|
jbk1043 | Word | 1 | 03-03-2013 01:46 PM |
Strip lf/cr from text
|
p3aul | Word | 9 | 08-18-2009 12:42 AM |