Mobile menu

Extract tables from a Word document
Thread poster: Noemi Carrera

Noemi Carrera  Identity Verified
Spain
Local time: 11:50
Member (2003)
English to Spanish
Oct 10, 2003

Hi all,

I would like to know if there is any method to extract tables from a Word document.

The text I am working on at the moment has a lot of pages and, apart from that, a lot of tables. This slows down Trados and Word itself.

Any ideas?

Thank you very much in advance.

Regards,

Noemí


Direct link Reply with quote
 

ttagir  Identity Verified
Local time: 12:50
Member (2002)
English to Russian
+ ...
U may work with 2 files. It helps sometimes:) Oct 10, 2003

Copy you file, say origin.doc into 3 copies: compare.doc, text.foc. and tables.doc
Open text doc and kill all tables. Open then tables and kill all text pieces. Then start TRADs TM WB and treat separately text.doc and tables doc. The resulting files when can be joined into opened compare.doc by past+copy from results of text and tabs treated.
In this case, 1) TRAD has not go mad with complex composition of page; 2) easily works with tabs and text separately.
It may also help if you like compsci and PC:)
Yours,
Tagir.

[Edited at 2003-10-10 11:10]


Direct link Reply with quote
 

jmadsen  Identity Verified
Local time: 11:50
Another trick Oct 10, 2003

If there are not too many tables, you can save a copy of the file and convert all tables to text.
Then you translate this file (not slowed by tables), save it and tranlate the original file (including tables) using the Tools - Translate feature from workbench.
Jørgen


Direct link Reply with quote
 
chcw
Hong Kong
4 Methods to Extract Tables from Your Document May 3

There are many methods to do so:

1. If you want to extract all tables in your document, you can use the following VBA codes:

Sub ExtractTablesFromOneDoc()
Dim objTable As Table
Dim objDoc As Document
Dim objNewDoc As Document
Dim objRange As Range

Set objDoc = ActiveDocument
Set objNewDoc = Documents.Add

For Each objTable In objDoc.Tables
objTable.Range.Select
Selection.Copy

' Paste tables to new document in rich text format.
Set objRange = objNewDoc.Range
objRange.Collapse Direction:=wdCollapseEnd
objRange.PasteSpecial DataType:=wdPasteRTF
objRange.Collapse Direction:=wdCollapseEnd
objRange.Text = vbCr
Next objTable

End Sub

2. If you only want to extract a specific table from your document, you can use the following code:

Sub ExtractSpecificTables()
Dim objTable As Table
Dim objDoc As Document
Dim objNewDoc As Document
Dim objRange As Range
Dim strTable As String

strTable = InputBox("Enter the table number: ")
Set objDoc = ActiveDocument
Set objNewDoc = Documents.Add

objDoc.Tables(strTable).Range.Select
Selection.Copy

Set objRange = objNewDoc.Range
objRange.Collapse Direction:=wdCollapseEnd
objRange.PasteSpecial DataType:=wdPasteRTF

End Sub

3. If you want to extract tables from multiple documents, you can use the following codes:

Sub ExtractTablesFromMultiDocs()
Dim objTable As Table
Dim objDoc As Document, objNewDoc As Document
Dim objRange As Range
Dim strFile As String, strFolder As String

' Initialization
strFolder = InputBox("Enter folder address here: ")
strFile = Dir(strFolder & "\" & "*.docx", vbNormal)

Set objNewDoc = Documents.Add

' Process each file in the folder.
While strFile ""
Set objDoc = Documents.Open(FileName:=strFolder & "\" & strFile)
Set objDoc = ActiveDocument

For Each objTable In objDoc.Tables
objTable.Range.Select
Selection.Copy

Set objRange = objNewDoc.Range
objRange.Collapse Direction:=wdCollapseEnd
objRange.PasteSpecial DataType:=wdPasteRTF
objRange.Collapse Direction:=wdCollapseEnd
objRange.Text = vbCr
Next objTable

objDoc.Save
objDoc.Close
strFile = Dir()
Wend

End Sub

4. Of course, you can copy and paste tables manually. But that will be time-consuming.

For more detailed information, you can refer to:

https://www.datanumen.com/blogs/4-methods-to-extract-tables-from-one-word-document-to-another/

Hope that helps


Direct link Reply with quote
 


To report site rules violations or get help, contact a site moderator:


You can also contact site staff by submitting a support request »

Extract tables from a Word document

Advanced search






PDF Translation - the Easy Way
TransPDF converts your PDFs to XLIFF ready for professional translation.

TransPDF converts your PDFs to XLIFF ready for professional translation. It also puts your translations back into the PDF to make new PDFs. Quicker and more accurate than hand-editing PDF. Includes free use of Infix PDF Editor with your translated PDFs.

More info »
WordFinder
The words you want Anywhere, Anytime

WordFinder is the market's fastest and easiest way of finding the right word, term, translation or synonym in one or more dictionaries. In our assortment you can choose among more than 120 dictionaries in 15 languages from leading publishers.

More info »



All of ProZ.com
  • All of ProZ.com
  • Term search
  • Jobs