tags:

views:

97

answers:

1

VBA is a programming language so I'll assume this question is ok on SO.

What API calls and other techniques can I use, to extract specific tables from an MS-Word document?

I need to write a program which will open several Word documents, and look inside for tables which have a certain text in Row 1 Column 1, and output those tables to another file, preferrably as cells in an Excel spreadsheet.

Is this possible? How would you tackle this? Where to start?

Thanks

+3  A: 

The Document.Tables collection contains all tables in a document.

Each Table in this collection has certain properties, such as .Rows, .Columns, or .Cell, which give access to a given row, a given column or a given cell.

The Table.Range.Copy method copies the given table to the clipboard.

The Worksheet.Paste method pastes the copied table into an Excel sheet, using the currently active cell as the insertion point.

GSerg
+1. Good answer!
Otaku