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
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
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.