1

I have a word document which contains some text and a table.

I am loading this document in TX TextControl.

I want to traverse through each cell in TX TextControl and extract the contents of each cell and save them in various fields in RTF format in a DB.

How can I traverse through each cell in a Table easily?

I have developed a solution but this code at times is extracting the cell borders also and this is messing up everything.

Here is the code snippet:

txImportFile.SelStart = txImportFile.TableCellStart(CurTableID, RowNum, 2) - 1
txImportFile.SelLength = txImportFile.TableCellLength(CurTableID, RowNum, 2)
mtd_question.RTFSelText = txImportFile.RTFSelText
'Code to save textracted text and graphics to DB goes here

I want to note that the table is very big and spans across many pages. A documents average size is 47 pages from which the table itself occupies around 31 pages.

TIA

Yogi Yang

Yogi Yang 007
  • 5,147
  • 10
  • 56
  • 77
  • TX Textcontrol: is that some sort of RTF control? If so, why aren't you using the native RTF control that comes with VB6? – BobRodes Apr 30 '14 at 02:48
  • Yes it is a RTF control with features similar to MS Word! Native RTF control cannot handle many advance features in documents like Tables, Sections, multi columns, etc. – Yogi Yang 007 May 01 '14 at 14:41
  • The native control can be "tricked" into handling the more advanced features. See my answer [here](http://www.tek-tips.com/viewthread.cfm?qid=1588186). – BobRodes May 01 '14 at 14:47
  • Note also that that answer is two years old. Currently, there is a version 2 of TOM, which is included in RichEdit version 6 and above. You should be able to substitute the TOM 2 objects in the code. For example, where it says ITextDocument put ITextDocument2. (All of this stuff is well documented on MSDN and the blogs. The VB6 implementation is a little more obscure.) – BobRodes May 01 '14 at 15:06

0 Answers0