Convert Word table to HTML in memory

Due to the odd control of Word merge cells, it is very difficult to determine the merge of cells in Word (technically, there is no merged property in the cell, it is only a method, so we have to "guess" what is merged).

Even though I'm not perfect, I have found one way to help with cell merging. If you save the file .docx

as filtered html file

(.htm), you can look at the caption in the .htm file and see the property colspan

for each cell.

I want to avoid the costly route by first storing the .docx as .htm (using the Document.SaveAs method), then parsing the .htm to determine the colspan values ​​for each cell.

Is there any way for me to directly save the table to memory in .htm format and then pull the values ​​out of it?

An alternative might be to use an algorithm that the conversation uses to determine the colspan, but I haven't found anything on the internet about this, and I want to avoid writing a complicated algorithm if possible.

+3
html ms-word


source to share


No one has answered this question yet

See similar questions:

0
How do I define a concatenated column and row in a word table?

or similar:

7205
Why does HTML consider "chucknorris" a color?
1929
HTML 5: is this a site, <br/ "> or <br/">?
1922
What are the valid values ​​for the id attribute in HTML?
1804
How do you display code snippets in MS Word save format and syntax highlighting?
1738
How do I create an HTML button that acts like a link?
1502
Redirect from an HTML page
1475
Converting HTML + CSS to PDF with PHP?
1104
What is the purpose of the "role" attribute in HTML?
665
Why not use tables for layout in HTML?
535
Word-wrap in HTML table



All Articles
Loading...
X
Show
Funny
Dev
Pics