Hi,
When saving a DOCX file to HTML, then save it back for a couple of times, I noticed some of the style names became very weird.
Code:
var doc = new Document(@".\styles.docx");
var htmlSaveOptions = new HtmlSaveOptions();
htmlSaveOptions.CssStyleSheetType = CssStyleSheetType.External;
doc.Save(@".\stylesOut.html", htmlSaveOptions);
for (int i = 0; i < 5; ++i)
{
var docReopen = new Document(@".\stylesOut.html");
docReopen.Save(@".\stylesOut.html", htmlSaveOptions);
}
var docResave = new Document(@".\stylesOut.html");
docResave.Save(@".\stylesFinal.docx");
I’ve attached the test files and a screenshot for your reference. This issue doesn’t happen if I used Word ‘save as html’ feature, could you please help me check this?
styles.zip (14.2 KB)
image.png (37.0 KB)
Thanks,