Need to convert word to html with track changes - all changes in Word to be visible

Hello Team,
While converting a compared word document to html I want the side bar also to be shown…
Like strikethrough, Underline is showing but side bar in the line is not shown in html.

To convert a Word document to HTML while ensuring that all tracked changes, including the sidebar indicators, are visible, you can use the Aspose.Words library. However, it seems that the sidebar indicators for revisions may not be directly rendered in the HTML output.

To ensure that all changes are visible, you might consider accepting or rejecting revisions before the conversion. This can be done using the AcceptAll or RejectAll methods from the Revisions collection. By managing the revisions in this way, you can control how the changes are represented in the final HTML output.

Here’s a basic example of how you can accept all revisions before converting to HTML:

Document doc = new Document("input.docx");

// Accept all revisions
doc.Revisions.AcceptAll();

// Save the document as HTML
doc.Save("output.html", SaveFormat.Html);

If you specifically need to show the sidebar indicators, you may need to implement a custom solution to represent these changes visually in the HTML, as the default conversion may not include them.

For further details on handling revisions, you can refer to the Aspose.Words documentation.

If you have any more specific requirements or need further assistance, feel free to ask!

@Raghul214 You can convert your document to HtmlFixed format and configure revisions appearance in the output document using RevisionOptions.

Document doc = new Document(@"C:\Temp\in.docx");

HtmlFixedSaveOptions opt = new HtmlFixedSaveOptions();
opt.PrettyFormat = true;
opt.ExportEmbeddedCss = true;
opt.ExportEmbeddedFonts = true;
opt.ExportEmbeddedImages = true;
opt.ExportEmbeddedSvg = true;

doc.Save(@"C:\Temp\out_html_fixed.html", opt);

In this case the output document will look the same as it looks in MS Word including revisions. Please note HtmlFixed is designed for viewing purposes and is not supposed to be edited or converted.

1 Like

Yes working fine Thanks for that

1 Like