This was obtained by referring to some posts on the Internet. Some posts cannot be debugged due to the poor key steps. Although I am at the cainiao level, I made some modifications step by step and finally got it out accidentally, happy!
FCKeditor uses FCKeditor. net_2.6.3 and fckeditor_2.6.4.1.
The default FCKeditor can be used to paste images from MS Word. However, when your Word documents contain images, an error occurs that the images cannot be displayed,
Here we want to import the Word documents directly. If the pictures are included, the pictures will be automatically separated and uploaded to the server and displayed in FCKeditor. (However, the import process is slow when the Word documents are large)
1. Add a Custom button for FCKeditor
Files to be modified:
1. fckconfig. js
2. zh-cn.js
3. fckeditorcode_ie.js (similar to gecko)
Fckconfig. JS: add the word document import button
Find fckconfig. toolbarsets ["default"] = [...
'Paste ', 'pastetext', 'pasteword', insert 'importword' after pasteword '.
Zh-cn.js
Set the Chinese description of the buttons above
Pasteword: "pasting from MS word ",
Importword: "importing Word documents ",
Fckeditorcode_ie.js display button in the button
Find
Case 'pasteword': B = new fcktoolbarbutton ('pasteword', fcklang. pasteword, null, null, false, true, 11); break;
This line is added later
Case 'importword': B = new fcktoolbarbutton ('importword', fcklang. importword, null, null, false, true, 11); break; add function for button
Find
Case 'pasteword': B = new fckpastewordcommand (); break;
This line is added later
Case 'importword': B = new fckdialogcommand ('importword', fcklang. importword, 'Dialog/importword. asp', 700,600); break;
In this way, the Custom button is set. When you click this button, the importword. aspx file is automatically displayed.
The rest is the work of. net. A folder download is provided here.
Http://download.csdn.net/source/1681907
Contains Microsoft. office. interOP. word. DLL and importword folders. The importword folder contains (importword. aspx \ importword. aspx. CS ). usage: Reference Microsoft. office. interOP. word. DLL. put the importword folder in the FCKeditor \ editor \ dialog folder and modify the two files.
1 \ modify the. CS file:
Doctype. invokemember ("saveas", system. reflection. bindingflags. invokemethod,
Null, Doc, new object [] {savefilename, wdsaveformat. wdformatfilteredhtml });
2 \ modify the. aspx File
<SCRIPT src = "../common/fck_dialog_common.js" type = "text/JavaScript"> </SCRIPT>
Success!
However, I think it is not convenient. Continue to study...