hi..
im in need of a free word editor which can be used in my website..

if any1 knows where i can find it, please let me know.and also tell me how to use it too...

Thanks..

Dani AI

Generated

As already suggested a browser editor (FreeTextBox) and wants to export the edited content to Word, the simplest, most reliable option is to treat the editor output as HTML and either stream that HTML to the browser as a .doc download or save the HTML to disk. Word will open HTML files saved with a .doc extension, so you avoid Office automation and can implement this quickly on an ASP.NET site. If you need a real .docx (no extension/format warning and better image handling), generate a .docx with the Open XML SDK or a third-party library instead.

Example (stream HTML to download; avoid Response.End()):

protected void btnSave_Click(object sender, EventArgs e)
{
    // get the edited HTML from the editor control (control.Text or Request.Form["editorId"])
    string editorHtml = myEditor.Text;

    string html = "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/></head><body>"
                  + editorHtml + "</body></html>";

    byte[] bytes = System.Text.Encoding.UTF8.GetBytes(html);

    Response.Clear();
    Response.Buffer = true;
    Response.ContentEncoding = System.Text.Encoding.UTF8;
    Response.ContentType = "application/msword";
    Response.AddHeader("Content-Disposition", "attachment; filename=Document.doc");
    Response.BinaryWrite(bytes);
    HttpContext.Current.ApplicationInstance.CompleteRequest();
}

To save a .doc file server-side:

string path = Server.MapPath("~/App_Data/Document.doc");
System.IO.File.WriteAllText(path, html, System.Text.Encoding.UTF8);

Key cautions and tips:

  • Word will show a format/extension warning for HTML saved as .doc; use .docx generation for production if that is unacceptable.
  • Do not automate Microsoft Office on a web server; it is unsupported and unreliable.
  • Sanitize the editor HTML on the server to strip scripts and unsafe attributes before saving or serving to prevent XSS. Use a vetted sanitizer library.
  • If storing content in a database, keep the HTML in an nvarchar(max) field and generate the .doc on demand when users download.
  • Images referenced by absolute URLs will load when Word opens the HTML; embedding images reliably requires creating a true .docx and adding image parts.

This approach matches what most sites use for quick exports while keeping server-side code simple and maintainable.

Recommended Answers

All 2 Replies

FreeTextBox is a good one.

hey thanks for the editor..but can u just suggest me that how can i save the data? im able to put it on my aspx page...but im not able to save the data.i want the data to be saved in .doc format.

please send me the process if u know..

thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.