Thread: [Solved] Macro to select tables
View Single Post
 
Old 04-14-2012, 12:36 PM
Stefan Blom's Avatar
Stefan Blom Stefan Blom is offline Windows 7 64bit Office 2010 32bit
Moderator
 
Join Date: Aug 2011
Posts: 4,003
Stefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to all
Default

Actually, you don't have to select anything. Once you have defined the range, make use of the Copy method, create a new document, and paste:

Code:
Dim rngParagraphs As Range
Dim NewDoc As Document
 
Set rngParagraphs = ActiveDocument.Range( _
Start:=ActiveDocument.Tables(1).Range.Start, _
End:=ActiveDocument.Tables(8).Range.End)
rngParagraphs.Copy
Set NewDoc = Documents.Add
NewDoc.Content.Paste
__________________
Stefan Blom
Microsoft Word MVP

Microsoft 365 apps for business
Windows 11 Professional
Reply With Quote