Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 03-06-2016, 04:37 PM
macropod's Avatar
macropod macropod is offline Adding to a macro Windows 7 64bit Adding to a macro Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Try:
Code:
Sub CopyTables()
Application.ScreenUpdating = False
Dim DocSrc As Document, DocTgt As Document, Tbl As Table, Rng As Range
Set DocSrc = ActiveDocument: Set DocTgt = Documents.Add
For Each Tbl In DocSrc.Tables
  Set Rng = DocTgt.Characters.Last
  With Rng
    .Collapse wdCollapseEnd
    .FormattedText = Tbl.Range.FormattedText
    .Tables(1).Style = "Table Grid"
    .Collapse wdCollapseEnd
    .InsertAfter vbCr
  End With
Next
Set DocSrc = Nothing: Set DocTgt = Nothing
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 

Tags
strip styles, table styles



Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding to a macro Adding a save as macro button to a template nparsons75 Word 6 01-08-2016 07:47 AM
Adding to a macro VBA Code for adding Macro to QAT OTPM Project 4 08-22-2013 01:33 PM
Adding to a macro Adding macro to normal.dotm programmatically etippelt Word VBA 6 04-08-2013 05:55 PM
Adding Macro menu to the right click menu (Word 2007) masam123 Word 0 10-14-2011 04:05 AM
Macro for automatically adding filename without .doc RPM7 Word VBA 0 04-29-2010 01:43 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:32 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft