Unable to Copy Table from HtmlFixed document and paste it in Excel | Aspose.Words for .NET

Hi,

when I use the following code:
Document docWR = new Document(@“table.docx”);

        HtmlFixedSaveOptions opts2 = new HtmlFixedSaveOptions();

HtmlFixedSaveOptions saveOptionsFixed = new HtmlFixedSaveOptions();
saveOptionsFixed.Encoding = new UTF8Encoding(true);
saveOptionsFixed.FontFormat = ExportFontFormat.Ttf;
saveOptionsFixed.ExportEmbeddedCss = true;
saveOptionsFixed.ExportEmbeddedImages = true;
saveOptionsFixed.ExportEmbeddedFonts = true;
saveOptionsFixed.ExportEmbeddedSvg = true;
saveOptionsFixed.PrettyFormat = true;
saveOptionsFixed.CssClassNamesPrefix = cssPrefix;
docWR.Save(@“html\table.html”, opts2);

, I see DIV tags only.
Unfortunately I cannot copy/paste the table from HTML to EXCEL like I can do it with a table.

How can I make it copyable ?

Regards,
Guido

@Nachti

In your case, we suggest you please save the document to HTML file format instead of HtmlFixed. Hope this helps you.

@tahir.manzoor

but we need the same layout like in Word file…

Regards,
Guido

@Nachti

To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input Word document.
  • Please attach the output file that shows the undesired behavior.
  • Please attach the expected output file that shows the desired behavior.
  • Please share the steps that you are using to achieve your requirement.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.

@tahir.manzoor,

this is not specific to content but for all tables saved with
HtmlFixedSaveOptions.

Open the HTML file afterwards and try copy/paste the table to Excel.

Kind regards,

@Nachti

You are facing the expected behavior of Aspose.Words. Please note that HTML and HtmlFixed are different file formats. The table in MS Word document is exported as <table> tag in HTML file format. However, it is not exported as <table> tag in HtmlFixed format. So, content of DIV tag will be copied in this case.

If you want to copy the table tag and paste it in Excel document, we suggest you please save the document to HTML format instead of HtmlFixed.