Extract tables from a Word document
Thread poster: Noemi Carrera

Noemi Carrera  Identity Verified
Spain
Local time: 21:19
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: 22:19
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: 21:19
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






LSP.expert
You’re a freelance translator? LSP.expert helps you manage your daily translation jobs. It’s easy, fast and secure.

How about you start tracking translation jobs and sending invoices in minutes? You can also manage your clients and generate reports about your business activities. So you always keep a clear view on your planning, AND you get a free 30 day trial period!

More info »
BaccS – Business Accounting Software
Modern desktop project management for freelance translators

BaccS makes it easy for translators to manage their projects, schedule tasks, create invoices, and view highly customizable reports. User-friendly, ProZ.com integration, community-driven development – a few reasons BaccS is trusted by translators!

More info »



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