12 Answers, 1 is accepted
You can import Word documents using the LoadDocxContent() method for DOCX content and LoadRtfContent() for RTF.
These methods can be used with different overloads to best fit the application scenario:
LoadDocxContent(Stream docxStream)—loads DOCX content from a Stream.
LoadDocxContent(string docxText)—loads DOCX content from an ASCII-encoded String.
LoadRtfContent(Stream rtfStream)—loads RTF content from a Stream.
LoadRtfContent(string rtfText)—loads RTF content from an ASCII-encoded String.
For more information check this article Importing from Word document.
Best regards,
Rumen
Progress Telerik

The MS Word like experience of RadEditor is demonstrated in the following demo: MS Word-like Experience.
The features like Bold, Italic, Underline, Strikethrough, Fore and Back Color, Insert Image, Insert Hyperlink and Insert Table are supported in the editor and in the exported DOCX file.
The Track Changes and Comments features are supported only inside RadEditor and will not persist in the exported DOCX file.
Best regards,
Rumen
Progress Telerik

The SaveAsDocX command executes the __doPostBack method to initiate a postback and on the server to call the ExportToDocx server method.
You can see how the SaveAsDocX command is implemented in the scripts.js file available with the demo installation as well as in the source code tab of the online demo:
scripts.js
Telerik.Web.UI.Editor.CommandList[
"
SaveAsDocx
"
] =
Telerik.Web.UI.Editor.CommandList[
"SaveAsRtf"
] =
Telerik.Web.UI.Editor.CommandList[
"SaveAsMarkdown"
] =
Telerik.Web.UI.Editor.CommandList[
"SaveAsPDF"
] =
function
(commandName, editor, args) {
__doPostBack(
""
, commandName);
};
DefaultCS.aspx.cs
protected
void
Page_Load(
object
sender, EventArgs e)
{
//select the Home tab by default
RadEditor1.RibbonBar.SelectedTabIndex = 1;
//handle postbacks from the export commands
try
{
string
evtArg = Request[
"__EVENTARGUMENT"
];
switch
(evtArg)
{
case
"SaveAsDocx"
:
RadEditor1.ExportToDocx();
break
;
case
"SaveAsRtf"
:
RadEditor1.ExportToRtf();
break
;
case
"SaveAsPDF"
:
RadEditor1.ExportToPdf();
break
;
case
"SaveAsMarkdown"
:
RadEditor1.ExportToMarkdown();
break
;
default
:
break
;
}
}
catch
(Exception ex)
{
RadNotification1.Show(
"There was an error during the export operation. Try simplifying the content and removing images/lists."
);
}
}
Regards,
Rumen
Progress Telerik

The Open option comes from the content-disposition=attachment HTTP header when the file comes from the server. With client-side export, it is up to the browser to decide what options to provide.
What you can do is:
- check the Save Exported Files article which can help you to save the exported file on the server
- look into using the OnExportContent to get the file RadEditor provides so you can change it. See this article for details.
- look into using a different HTML->PDF conversion tool as explained in this section of the documentation. It also links a blog post that shows how you can use the Telerik Document Processing Library for this.
Regards,
Rumen
Progress Telerik

Hi Rumen,
I have referred the Save
Exported Files article and used the Page Method. The "storeFile(string base64)"
method is not storing any file data in the mentioned file path, but
"OnSucceeded(data)" is being called and the data is getting prompted as an
alert.
And, I believe the given
code should work only for PDF, but I want to store the file as a word document.
What are the possible changes to be made for storing as word document? Kindly
help me on this.

Hi Rumen,
"public static string storeFile(string base64)" - This method is not at all invoking when initiate the call from "function callMyPageMethod(arg)" method. Is any other configuration have to be done to make this call? We are completely blocked to move forward on this implementation, can you please help us?
You can easily save the docx file to the server using this approach:
ASPX:
<
form
id
=
"form1"
runat
=
"server"
>
<
asp:ScriptManager
runat
=
"server"
/>
<
telerik:RadEditor
RenderMode
=
"Lightweight"
runat
=
"server"
ID
=
"RadEditor1"
OnExportContent
=
"RadEditor1_ExportContent"
>
</
telerik:RadEditor
>
<
asp:Button
runat
=
"server"
ID
=
"Button1"
Text
=
"Export to PDF"
OnClick
=
"Button1_Click"
/>
</
form
>
Codebehind:
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Web;
using
System.Web.UI;
using
System.Web.UI.WebControls;
using
System.IO;
using
Telerik.Web.UI;
public
partial
class
Default2 : System.Web.UI.Page
{
protected
void
RadEditor1_ExportContent(
object
sender, EditorExportingArgs e)
{
string
url = String.Format(
"~/{0}.docx"
, RadEditor1.ExportSettings.FileName);
//set here the path where you want to save the docx file with the contents from RadEditor
string
path = Server.MapPath(url);
if
(File.Exists(path))
{
File.Delete(path);
}
using
(FileStream fs = File.Create(path))
{
Byte[] info = System.Text.Encoding.Default.GetBytes(e.ExportOutput);
fs.Write(info, 0, info.Length);
}
e.Cancel =
true
;
}
protected
void
Button1_Click(
object
sender, EventArgs e)
{
RadEditor1.ExportToDocx();
}
}
You can find attached a sample project attached to my reply.
Best regards,
Rumen
Progress Telerik

Thanks Rumen,
I am able to export external images to word but on using the Image Manager to export images to word document it is throwing System.net.web exception at
byte[] docxBinaryData = docxProvider.Export(flowDocument);
Kindly help me on this.
I'm glad the sample provided by my colleague Rumen has proven helpful in saving the document. As for the remaining requirements, I suggest that you open a formal support ticket and send us the modified ExportToDocx.zip sample to demonstrate the specific issue so we can continue providing assistance on this case.
Regards,
Eyup
Progress Telerik