Question:
How can an external program read the contents of a table inside a Word document?
smdelfin
2011-11-16 00:40:02 UTC
I want to process a lot of Word documents with a table inside each of them.
The tables don't contain fields. But the tables do contain text.
So how can I get those texts?
Three answers:
peteams
2011-11-16 01:17:43 UTC
If you're using a Microsoft platform, most probably Visual Studio, then you'll find you'll have a set of objects available to you that allow you to create and manipulate Office documents. Below is the entry point to the .NET Microsoft.Office.Interop.Word namespace. There is a native alternative to the .NET wrappers available through COM.



If you're using a recent version of Office, 97 onward, and using the new formats, like .docx, then you can directly read and manipulate the documents. You'll find the files are zipped XML, if you unzip a .docx file you'll find a tonne of XML inside and should be able to find documentation describing its format (it's an open standard).
Laurence I
2011-11-16 01:05:51 UTC
office applications

=============

using Excel you can Program in using VBA.

VBA can Reference office DLL's to add functionality.

this includes all the office features.



you get a full set of programming functions, including being

able to step through rows of a document rows of a table

columns of a table etc etc.



you can use this to megre the contents of one table from several documents

into another document and all sorts of other things.



you can open and close any office document from within the VBA macros

that you create inside your excel worksheet
Albert Castillo
2011-11-16 00:43:49 UTC
Double click the tables, highlight the contents. Copy and Paste.



Alternative to Word is use LibreOffice.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...