Welcome to the JavaScript feedback portal. We’re happy you’re here! If you have feedback on how to improve the JavaScript, we’d love to hear it!

  • Check out the features or bugs others have reported and vote on your favorites. Feedback will be prioritized based on popularity.
  • If you have feedback that’s not listed yet, submit your own.

Thanks for joining our community and helping improve Syncfusion products!

2
Votes

Preserve Microsoft Word native elements(Field, Shape, etc.) while copying into Document Editor.

  1. Currently, we are writing the copied content as HTML and copying the same to the clipboard using document.execCommand() which copies only the rendered elements and ignores the MS Word native elements

MS Word Copied Structure

document.execCommand()  Copied Structure

<p class=MsoNormal><!--[if supportFields]><span style='mso-element:field-begin'></span><span


style='mso-spacerun:yes'> </span>MERGEFIELD<span style='mso-spacerun:yes'>


</span>address<span style='mso-spacerun:yes'>  </span>\* MERGEFORMAT <span


style='mso-element:field-separator'></span><![endif]--><span style='mso-no-proof:


yes'>«address»</span><!--[if supportFields]><span style='mso-element:field-end'></span><![endif]--></p>

<p class=MsoNormal>«address»</p>

  1. To preserve the native elements for pasting to MS Word we need to copy the MS Word required native element structure. On analyzing we found we are able to achieve the same using Clipboard.
  2. It lacks compatibility with all modern browsers.
  3. In future releases, if the Clipboard API compatibility is added we will include the writing of native-supported HTML clipboard content.
  4. Workaround
    1. Download the document as Docx in DocumentEditor instead of copying.
    2. Open the downloaded document in MS Word and then copy the required content.