ASP.Net富文本编辑控件

发布于 2024-07-23 21:55:15 字数 164 浏览 2 评论 0原文

我正在寻找可以在ASP.Net中使用的控件,提供富文本编辑功能,例如可以在线工作的Office Live、Google Docs。 另一个需要的功能是下载为 Microsoft Word 格式。

有推荐的 ASP.Net 内置控件或示例/文档吗?

提前致谢, 乔治

I am looking for control which could be used in ASP.Net, providing rich text editing function, like Office Live, Google Docs which could work on line. Another function needed is download into Microsoft Word format.

Any recommended ASP.Net built-in controls or samples/documents?

thanks in advance,
George

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

偷得浮生 2024-07-30 21:55:15

FCKeditor 怎么样? 它不是内置的,但它是最强大的编辑器之一。

您可以从 fckeditor 控件实例的 Value 属性获取 HTML:

string s = fckeditor1.Value

现在将此字符串保存到文件(例如 MyPage.html)中。 现在创建 MS World 应用程序的实例并使用该应用程序实例打开此 html 文件 (myPage.html)。
打开后,您可以将此打开的文件另存为word文档! 但这需要您在计算机上安装 MS Office:

private Word.ApplicationClass wordApp = new Word.ApplicationClass();

object fileName = ""; //Path to HTML File
object newFile = ""; //Path where you want to save doc file

bject missing = System.Reflection.Missing.Value;

Word.Document htmlDoc = WordApp.Documents.Open(ref fileName, ref missing, 
     ref readOnly, ref missing, ref missing, ref missing, ref missing, 
     ref missing, ref missing, ref missing, ref missing, ref isVisible);

object docFormat = Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatDocument;
   //Please check if this is correct value from enumeration

htmlDoc.SaveAs(ref newFile,ref docFormat, ref missing,ref missing,ref missing, 
     ref missing,ref missing,ref missing, ref missing,ref missing,ref missing, 
     ref missing,ref missing,ref missing, ref missing,ref missing);

htmlDoc.Close();
wordApp.Quit();

PS:- 它已经使用了很长时间,请不要介意在使用此代码和方法之前必须做一些工作。

What about FCKeditor? It is not built in but it is one of the most capable editor.

You can get HTML from fckeditor control instance's Value property:

string s = fckeditor1.Value

Now save this string to a file say, MyPage.html. Now create an instance of MS World application and open this html file (myPage.html) with that application instance.
Once opened you can save this opened file as word document! But this requires that you have MS office installed on machine:

private Word.ApplicationClass wordApp = new Word.ApplicationClass();

object fileName = ""; //Path to HTML File
object newFile = ""; //Path where you want to save doc file

bject missing = System.Reflection.Missing.Value;

Word.Document htmlDoc = WordApp.Documents.Open(ref fileName, ref missing, 
     ref readOnly, ref missing, ref missing, ref missing, ref missing, 
     ref missing, ref missing, ref missing, ref missing, ref isVisible);

object docFormat = Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatDocument;
   //Please check if this is correct value from enumeration

htmlDoc.SaveAs(ref newFile,ref docFormat, ref missing,ref missing,ref missing, 
     ref missing,ref missing,ref missing, ref missing,ref missing,ref missing, 
     ref missing,ref missing,ref missing, ref missing,ref missing);

htmlDoc.Close();
wordApp.Quit();

PS:- It has been long time worked with this please don't mind if you have to do bit of work before using this code and method.

以歌曲疗慰 2024-07-30 21:55:15

Ajax 控制工具包中的 HTMl 编辑器怎么样。 然后就可以获取内容并将其另存为wod文档。 此主题有 2 个链接,其中包含有关如何控制 HTML 到 word 的详细信息。

What about HTMl editor in Ajax Control toolkit. You can then get the content and save it as wod document. This thread has 2 links which had details about how to control HTML to word.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文