Ticket T189677
Visible to All Users

ASPxHtmlEditor displays only a part of the text pasted from MS Word

created 10 years ago

Hi,
We have a problem with pasting from Word.
I have included a document from an end user where just a part of the Word document is pasted in the editor. It is pasted with the 'Paste from Word' button.
Do you have a solution for this?
In the project the editor is build up from code behind, see code below.
Kind regards Barbara

Public Shared Sub SetEditor(ByVal AnEditor As ASPxHtmlEditor, ByVal AHeight As Integer)
        AnEditor.Width = Unit.Percentage(100)
        AnEditor.Height = Unit.Pixel(AHeight)
        AnEditor.SettingsHtmlEditing.EnterMode = HtmlEditorEnterMode.BR
        AnEditor.Settings.AllowPreview = False
        AnEditor.Settings.AllowHtmlView = True
        AnEditor.Styles.Theme = "Default"
        AnEditor.ToolbarMode = HtmlEditorToolbarMode.Ribbon
        'AnEditor.CreateDefaultToolbars(True)
        AnEditor.CreateDefaultRibbonTabs(True)
        Dim mycss As HtmlEditorCssFile = New HtmlEditorCssFile()
        mycss.FilePath = "Editor.css"
        AnEditor.CssFiles.Add(mycss)
        For Each rt As HERibbonTabBase In AnEditor.RibbonTabs
            If rt.Text = "Home" Then
                For Each g As HERibbonGroupBase In rt.Groups
                    If g.Text = "Font" Then
                        For Each o As Object In g.Items
                            If o.GetType().ToString.Contains("HEFontNameRibbonCommand") Then
                                o.Visible = False
                            End If
                            If o.GetType().ToString.Contains("HEFontSizeRibbonCommand") Then
                                o.Visible = False
                            End If
                            If o.GetType().ToString.Contains("HEParagraphFormattingRibbonCommand") Then
                                o.Visible = False
                            End If
                        Next
                        Dim cssbutton As HECustomCssRibbonCommand
                        cssbutton = New HECustomCssRibbonCommand()
                        cssbutton.Items.Add(New ToolbarCustomCssListEditItem("Tussenkop", "span", "Tussenkop"))
                        cssbutton.Items.Add(New ToolbarCustomCssListEditItem("Plaatje links, tekst rechts", "span", "left_float_image"))
                        cssbutton.Items.Add(New ToolbarCustomCssListEditItem("Plaatje rechts, tekst links", "span", "right_float_image"))
                        g.Items.Add(cssbutton)
                    End If
                    If g.Text = "Clipboard" Then
                        For Each o As Object In g.Items
                            If o.GetType().ToString.Contains("HEPasteSelectionRibbonCommand") Then
                                o.Visible = False
                            End If
                        Next
                    End If
                Next
            End If
        Next
        'shortcuts
        AnEditor.Shortcuts.Add("Ctrl+V", "pastefromworddialog")
        AnEditor.Shortcuts.Add("Shift+Ins", "pastefromworddialog")
        'context menu items
        'AnEditor.ContextMenuItems.Clear()
        AnEditor.ContextMenuItems.Insert(0, New HtmlEditorContextMenuItem("Select all", "selectall"))
        AnEditor.ContextMenuItems.Insert(1, New HtmlEditorContextMenuItem("Paste", "pastefromworddialog"))
    End Sub

Comments (3)
Lanette (DevExpress Support) 10 years ago

    Hello,

    I've examined your code snippet and don't see any problems. I'm afraid that currently it's difficult to determine the cause of the issue without observing your full code. It's not clear where you're calling the SetEditor method. Please send us a sample runnable project to reproduce the problem on our side. We will do our best to help you.

      Hi,
      Sorry for the delay. I have build a very simple website, see attachment, with just a HTMLEditor. When I paste the Word text from my previous comment, just a part of the text is pasted. When I paste the text from the attached Word text, the pasted text still contains format. All texts are pasted with the 'Paste from Word' button and 'Remove font family' is checked. I have included 2 screenshots with my result.
      What can I do to prevent it?
      Kind regards, Barbara

      DevExpress Support Team 9 years ago

        Hello,

        To process your recent post more efficiently, I created a separate ticket on your behalf: T288536: ASPxHtmlEditor - Text pasted from MS Word keeps a format if "Remove font family" is checked. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.

        Answers approved by DevExpress Support

        created 9 years ago (modified 9 years ago)

        Hello,

        Thank you for the provided project. I have examined it but did not succeed in reproducing the issue on my side. Please see the attachment. Would you please provide me with a screencast illustrating the problem in action? It may be that I am missing some required steps. I am looking forward to your reply.

          Comments (2)

            I upgraded to 15.1.6. That solved this problem.
            Kind regards, Barbara

            DevExpress Support Team 9 years ago

              Hello,

              I am happy to hear that  the issue is resolved. Please feel free to ask if you need any further assistance.

              Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

              Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.