有关html转word的问题,请教高手 目前有个C#项目,其中有个功能要实现html转为word格式,我是用程序直接将html文件扩展名直接改为.doc就可以完成转换了,可是有一个问题,如果html页面中包含图片,转为word格式无法将图片复制到文档中,还是需要通过图片路径显示图片,请问,能不能用程序将图片复制到文档中啊 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 //插入图片 string FileName = Picture;//图片所在路径 object LinkToFile = false; object SaveWithDocument = true; object Anchor = WordDoc.Application.Selection.Range; WordDoc.Application.ActiveDocument.InlineShapes.AddPicture(FileName, ref LinkToFile, ref SaveWithDocument, ref Anchor); WordDoc.Application.ActiveDocument.InlineShapes[1].Width = 100f;//图片宽度 WordDoc.Application.ActiveDocument.InlineShapes[1].Height = 100f;//图片高度 //将图片设置为四周环绕型 Word.Shape s = WordDoc.Application.ActiveDocument.InlineShapes[1].ConvertToShape(); s.WrapFormat.Type = Word.WdWrapType.wdWrapSquare; Application.Selection.InsertFile(htmlPath, ref missing, ref falseObj, ref missing, ref missing); Word.ApplicationClass wordApp = new Word.ApplicationClass();object visible = false;Word.Document doc = Application.Documents.Add(ref missing, ref missing, ref missing, ref visible);wordApp.Selection.InsertFile(htmlPath, ref missing, ref falseObj, ref missing, ref missing); 我做过word转html的 反过来应该不会出问题吧 sl2161,wowoj2ee,wowoj2ee这样直接插入图片,位置怎么控制,转换成word之后要和原先的html页面格式一模一样 求TrackMouseEvent函数的使用。 获取文件夹路径问题 c#调用c编写的动态库,出现错误! C# 操作ACCESS的几个问题,求解ing C# 无边窗体 如何一个按钮同时实现最大化和还原? 新手求助,关于C#下操纵word文档 DataGrid数据绑定时出现"未将对象引用设置到对象的实例"异常,怎么回事? C#可否使用全局钩子技术?我的程序需要热键呼出! 自绘窗口阴影 很弱的问题,怎样往XML文件中添加新节点? 如何保证自己的自定义类库不被他人利用 菜鸟土问,C#和C++的类变量类型
//插入图片
string FileName = Picture;//图片所在路径
object LinkToFile = false;
object SaveWithDocument = true;
object Anchor = WordDoc.Application.Selection.Range;
WordDoc.Application.ActiveDocument.InlineShapes.AddPicture(FileName, ref LinkToFile, ref SaveWithDocument, ref Anchor);
WordDoc.Application.ActiveDocument.InlineShapes[1].Width = 100f;//图片宽度
WordDoc.Application.ActiveDocument.InlineShapes[1].Height = 100f;//图片高度
//将图片设置为四周环绕型
Word.Shape s = WordDoc.Application.ActiveDocument.InlineShapes[1].ConvertToShape();
s.WrapFormat.Type = Word.WdWrapType.wdWrapSquare;
Application.Selection.InsertFile(htmlPath, ref missing, ref falseObj, ref missing, ref missing);
object visible = false;
Word.Document doc = Application.Documents.Add(ref missing, ref missing, ref missing, ref visible);wordApp.Selection.InsertFile(htmlPath, ref missing, ref falseObj, ref missing, ref missing);
sl2161,wowoj2ee,wowoj2ee
这样直接插入图片,位置怎么控制,转换成word之后要和原先的html页面格式一模一样