We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Insert Comments on a given text while converting from HTML to Word and get these while reconverting from WOrd to HTML


I am converting a Word document to HTML into multiple HTML files based on Page Splitting functionality. And adding some custom HTML attributes to the converted HTML like below -

Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum has been the industry’s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.
It was popularised in the 1960s with the release of
 sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.


As you can see, i have some custom HTML with class CAELnote and id 296,297,298. So all I need to do is, while converting this HTML to WOrd, somehow I need to know about these id and classes and then I will get the actual data from DB and make the HTML string and will add that HTML string to these spans as the comment.

So in the exported Word file, I will see the three comments and the details will be as per these ids from DB. And my next question is, somehow I need to know about these ids while converting this ame document from Word to back to the HTML. So I will know that these are the comments I have exported through my application and if there is know id or(some custom random id) is there, then I will know that these are the new ones and I need to insert them into the DB and the returned id needs to be updated in the same manner as described above into the newly converted HTML.
Capture.JPG (146.4 KB)

I am attaching a screenshot that how the HTML looklike into my application according to these ids and classes.



Thanks for your inquiry. Please note while converting HTML to Word document, Aspose.Words does not support to work directly with HTML but it is imported in Aspose.Words DOM and processed. You can try one of the following solutions.