Parsing tables with VBA
Posted on 2004-10-12
I'm currently involved in a project where I need to convert word documents to seperate notes documents in a Lotus Notes Database.
To do this, I need to parse the word document using VBA OLE programming.
Currently my project is finished to a point that I can open the document and walk through it paragraph by paragraph and translate the text to a degree that I can import all regular text and titles and format it as I should.
Now I get to a point where I need to import the tables in the document.
When walking through the document paragraph by paragraph, when I enter a table, I can see this with the following :
Application.Selection.Information(wdWithinTable) will return true if the paragrap I'm looking at is inside a table.
Now it gets complicated, I can walk through all paragraphs, but I have no idea as to where I am inside the table.
Is there a way to parse the table, once I am inside the table, paragraph by paragraph, cell by cell and in advance see what cells are merged inside the table, using VBA code ?
Any help would be greatly appreciated.