zoukankan
html css js c++ java
在asp.net生成的word文档中插入图片
我用以下方法将一个html文件保存成word文件并且再查入一张图片
object Nothing=System.Reflection.Missing.Value;
object
srcFileName=@"D:\aa.html
";
object
dstFileName=@"d:\li.doc
";
object objt=true;
Word.Application wordApp=new Word.ApplicationClass();
Word.Document wordDoc=null;
object format=Word.WdSaveFormat.wdFormatDocument;
try
{
wordDoc=wordApp.Documents.Open(ref srcFileName,ref format, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing);
//图片
Word.Shape oShape= wordDoc.Shapes.AddPicture("D:\\DL_01.gif",ref Nothing,ref objt,ref Nothing,ref Nothing,ref Nothing,ref Nothing,ref Nothing);
oShape.WrapFormat.Type =Word.WdWrapType.wdWrapSquare;
//将htm文件save as成doc文件
wordDoc.SaveAs(ref dstFileName,ref format, ref Nothing, ref Nothing, ref Nothing, ref Nothing,
ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing);
}
finally
{
wordDoc.Close(ref Nothing, ref Nothing, ref Nothing);
wordApp.Quit(ref Nothing, ref Nothing, ref Nothing);
}
http://community.csdn.net/Expert/topic/3541/3541955.xml?temp=.7204096
查看全文
相关阅读:
忍者必须死3 模拟器按键设置
C# 工厂模式 个人基本流程
WPF Boolean类型转化器收集 反转转化器
Json实体类驼峰名称转化器
TDengine + EMQ X + Grafana 轻松搭建高效低成本的边缘侧工业互联网平台
呼声最高的数据更新功能来了,用户需要什么,我们就开源什么
年轻人不讲武德,TDengine边缘侧数据存储方案挑战SQLite
保姆级演示一分钟搞定TDengine的下载安装
双汇大数据方案选型:从棘手的InfluxDB+Redis到毫秒级查询的TDengine
HiveMQ TDengine extension 使用指南
原文地址:https://www.cnblogs.com/xryyforver/p/1508559.html
最新文章
二叉查找树的相关操作
堆排序
elelogger:一款明快的博客园主题
技术文档导航
使用JS将数字从汉字形式转化为阿拉伯形式
罗马数字转整数
折纸问题
js层序遍历多叉树
JS求组合数
合并两个有序数组为一个新的有序数组
热门文章
字符串的一个算法题
box-shadow单边阴影
牛客网-赛马网-node输入输出模板
数列类题目
git 如何删除一个文件名为nul的文件
git 如何在本地批量删除匹配名称分支
关于我升级VS16.8,结果一些项目运行报错“Phx.FatalError”这件事
利用.NET 5和Github Action 自动执行米游社原神每日签到福利
C# 导出表格时表头优化思路
git 如何在本地同步远程已经删除的分支
Copyright © 2011-2022 走看看