CuteEditor小结
来源:互联网 发布:淘宝手机助手. 编辑:程序博客网 时间:2024/06/08 17:04
1 CuteEditor Html中显示Word格式粘贴的文章[CuteEditor WordToHtml]
2 CuteEditor使用详解 收藏
3 CuteEditor 使用[转]
3 word转换到CuteEditor:
函数uploadFileToEditor()的参数: urlstr 是指你要求的word文档的位置,(不知道为什么,貌似文件名中假如出现空格的时候,就会出问题,所以记住这一点,希望有人帮忙解答!)
同样...记得引用Microsoft.Office.Interop.Word;.dll
然后再文件上面添加:
using System.Web.UI.HtmlControls;
using Word = Microsoft.Office.Interop.Word;
using System.IO;
private void uploadFileToEditor(string urlstr) { //string filename = Request.QueryString["wordname"]; string filename = WordToHtml(urlstr); StreamReader fread = new StreamReader(filename, System.Text.Encoding.GetEncoding("gb2312")); string ss = fread.ReadToEnd(); Editor1.Text = ss; //Response.Write(ss); fread.Close(); fread.Dispose(); } private string WordToHtml(object wordFileName) { //在此处放置用户代码以初始化页面 Word.ApplicationClass word = new Word.ApplicationClass(); Type wordType = word.GetType(); Word.Documents docs = word.Documents; //打开文件 Type docsType = docs.GetType(); Word.Document doc = (Word.Document)docsType.InvokeMember("Open", System.Reflection.BindingFlags.InvokeMethod, null, docs, new Object[] { wordFileName, true, true }); //转换格式,另存为 Type docType = doc.GetType(); string wordSaveFileName = wordFileName.ToString(); string strSaveFileName = wordSaveFileName.Substring(0, wordSaveFileName.Length - 3) + "html"; object saveFileName = (object)strSaveFileName; docType.InvokeMember("SaveAs", System.Reflection.BindingFlags.InvokeMethod, null, doc, new object[] { saveFileName, Word.WdSaveFormat.wdFormatFilteredHTML }); docType.InvokeMember("Close", System.Reflection.BindingFlags.InvokeMethod, null, doc, null); //退出 Word wordType.InvokeMember("Quit", System.Reflection.BindingFlags.InvokeMethod, null, word, null); return saveFileName.ToString(); }
这个用法,有点笨吧,我是用来给CuteEditor添加”模板“的。
最主要的一句话:
string ss = fread.ReadToEnd();
Editor1.Text = ss;
.....不过貌似,还是有些格式的问题:
原图:
在CuteEditor里面显示的格式:
......暂时没找到解决方法.....待续...
- CuteEditor小结
- CuteEditor试用
- CuteEditor使用指南!
- CuteEditor配置
- CuteEditor编辑器
- CuteEditor使用手记
- CuteEditor配置
- CuteEditor使用手记
- CuteEditor编辑器
- CuteEditor 5.0 的使用
- CuteEditor 5.0的安装
- CuteEditor 5.0 的使用
- CuteEditor 使用[转]
- CuteEditor 6.0 使用方法详解
- CuteEditor配置 .net控件
- cuteeditor详细设置
- CuteEditor 6 使用详解
- CuteEditor使用详解
- 取得应用程序的根目录
- grep命令的知识.
- 记录格式
- 公布 骗子 失色 QQ592722361 shiseheike.blog.163.com 骗去150元 大家看分享,别让人再受他骗
- 网络流量查看 nload安装
- CuteEditor小结
- serialVersionUID
- Cocos2d-x网游开发之添加curl库到vs2010中
- 基于最大互信息的运动目标检测
- chm文件无法搜索或者MSDN搜索失效解决方法
- linux 中使用ls命令对文件进行排序-- 基于文件大小或者修改时间
- Selenium数据驱动之EXCEL
- 这十月,与C++代码相伴的日子
- phpunit 测试 thinkphp action