Tags for Word or similiar


In my project I generate programmatically HTML files with some tags, for example,

<br style="mso-break-type:section-break"/>
<span style="mso-element:field-separator"> 
<w:Sdt SdtDocPart="t" DocPartType="Table of Contents" DocPartUnique="t" ID="182337302">.

That file is converted to docx using Microsoft Word automation that is already deprecated. Those tags are included to generate a Table of Contents and other stuffs.
We would like to use Aspose.Words for Java to convert that HTML to Docx. What should we have to change in that HTML to make it possible a conversion to Docx generating a Table of Contents?

Thanks in advanced,

@bergpatricio As I can see you are using MS Word specific MSO attributes and tags in your HTML. I am afraid Aspose.Words does not fully support these attributes and tags. This feature request is logged as WORDSNET-10399.

Regarding your HTML snippet.

  1. Section break can be inserted using similar HTML tag as in your HTML:
<br style="page-break-before:always; clear:both; mso-break-type:section-break" />
  1. Table of contents can be inserted using the following HTML code:
<p style="margin-top:0pt; margin-bottom:5pt">
	<span style="-aw-field-start:true"></span><span style="-aw-field-code:' TOC \\o &quot;1-3&quot; \\h \\z \\u '"></span><span style="-aw-field-separator:true"></span><span style="-aw-field-end:true"></span>

If your goal is document generation I would suggest to use either template and generate document from template using Mail Merge or LINQ Reporting Engine or using Aspose.Words API.

Please note, Aspose.Words is designed to work with MS Word documents. HTML documents and MS Word documents object models are quite different and it is not always possible to provide 100% fidelity after conversion one format to another.