Paste from word loses formatting

Last post 03-06-2009, 7:22 AM by Flintstone. 2 replies.
Sort Posts: Previous Next
  •  02-26-2009, 9:36 AM 49277

    Paste from word loses formatting

    This also happens in your Demos on richtextbox.net
     
    Some formatting is lost when pasting from Word.

    I have uploaded a Word document for you to test with:
     
    Filed under:
  •  02-26-2009, 3:25 PM 49289 in reply to 49277

    Re: Paste from word loses formatting

    Flintstone,
     
    Here is the origianl code from Word:
      
    1. <strong>  
    2. <h1 style="margin: 0cm 0cm 0pt"><span lang="EN-GB"><u><font color="#000000" size="7" face="Times New Roman">  
    3. <h1 style="margin: 0cm 0cm 0pt"><span lang="EN-GB"><u><font color="#000000" size="7" face="Times New Roman">  
    4. <h1 style="margin: 0cm 0cm 0pt"><span lang="EN-GB"><u><font color="#000000" size="7" face="Times New Roman">  
    5. <h1 style="margin: 0cm 0cm 0pt"><span lang="EN-GB"><u><font color="#000000" size="7" face="Times New Roman">This is some text</font></u></span></h1>  
    6. <p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span lang="EN-GB"><o:p><font size="2">&nbsp;</font></o:p></span></p>  
    7. <p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span lang="EN-GB"><o:p><font size="2">&nbsp;</font></o:p></span></p>  
    8. <p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span style="color: blue" lang="EN-GB"><font size="2">And this too<o:p></o:p></font></span></p>  
    9. <p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span lang="EN-GB"><o:p><font size="2">&nbsp;</font></o:p></span></p>  
    10. <p style="margin: 0cm 0cm 0pt" class="MsoNormal"><span lang="EN-GB"><font size="2">Hehe</font></span></p>  
    11. </font></u></span></h1>  
    12. </font></u></span></h1>  
    13. </font></u></span></h1>  
    14. </strong>  

     
    If you use the PasteWord funtion  of cute editor,  here is the result:
     
    1. <strong>  
    2. <h1 style="margin: 0cm 0cm 0pt"><span lang="EN-GB"><u><font color="#000000" size="7" face="Times New Roman">  
    3. <h1 style="margin: 0cm 0cm 0pt"><span lang="EN-GB"><u><font color="#000000" size="7" face="Times New Roman">  
    4. <h1 style="margin: 0cm 0cm 0pt"><span lang="EN-GB"><u><font color="#000000" size="7" face="Times New Roman">  
    5. <h1 style="margin: 0cm 0cm 0pt"><span lang="EN-GB"><u><font color="#000000" size="7" face="Times New Roman">  
    6. <h1><u>This is some text</u></h1>  
    7. <p>&nbsp;</p>  
    8. <p>&nbsp;</p>  
    9. <p><span style="color: blue">And this too</span></p>  
    10. <p>&nbsp;</p>  
    11. <p>Hehe</p>  
    12. </font></u></span></h1>  
    13. </font></u></span></h1>  
    14. </font></u></span></h1>  
    15. </font></u></span></h1>  
    16. </strong>  

    Can you explain what's wrong with the above conversion?
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  03-06-2009, 7:22 AM 49554 in reply to 49289

    Re: Paste from word loses formatting

    Sure, if you think that the word source you posted is correct then maybe that is one part of the problem ... open the file in Word and you can easily see the differences.
     
    1) The font style I used for "THIS IS SOME TEXT" is "Algerian" (standard Windows font) ... the font name "Algerian" is not mentioned in the original Word source that you have posted, "Times New Roman" is used instead - there must be an issue with the way you are obtaining the source.
     
    2) If you paste the text into Firefox you get a different result than IE ... "THIS IS SOME TEXT" is no longer underlined and it is "Times New Roman" instead of "Algerian"
     
    We have received a lot of complaints from our customers about this issue.
     
     
View as RSS news feed in XML