View Single Post
  #2   Report Post  
Posted to microsoft.public.vb,microsoft.public.word.tables,microsoft.public.word
Cindy M. Cindy M. is offline
external usenet poster
 
Posts: 2,416
Default Parse Word document into XML

Hi TheEwook,

I use the Microsoft Word 11.0 Object Library (MSWORD.OLB) to parse a
MSWord document into a XML document.

My problem is how to know in a table that a cell is merge ? And if this
cell is merge how to know which cells are merge ?
In my XML document I use colspan and rowspan in TD/TR for merge
cells.

I recommend you use the XML property to get the WordProcessingML, then
transform that into your own XML. There's no really good way, using
Word's object model, to determine whether a Word table contains merged
cells, and in what way they're merged relative to the other cells in the
table. But the round-trip HTML and the WordProcessingML do contain this
information.

An alternative would be to copy just the table to another document, save
it as a "web page", then extract the HTML from that.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)