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
查看全文
相关阅读:
海泉湾
ns2的wirelessphy中添加定时器
ns2能量模型添加充电模型
用gawk和gnuplot来分析ns2的trace文件
[转载]ns2中的能量模型
配置本地SVN[转载]
EMQ插件通过HTTP连接认证服务器实现认证
在K8S上跑一个helloworld
EMQ插件组合实现物联网边缘平台的设备通信管理
在CentOS7上搭建Kubernetes
原文地址:https://www.cnblogs.com/xryyforver/p/1508559.html
最新文章
设计模式之单例模式(一) zkh
编写高效的android代码(译文)
子类继承父类后重载protected方法提升访问权限为public
在Android上使用Http客户端的选择(译文)
android中利用java.lang.reflect.Proxy实现私有接口
关于LongClick与LongPress的区别与会发生的问题
关于ListView的不同view的加载问题
android 4.0 sdk 源码放出 本人亲自打包这里可以下载~
让Spinner的显示条目与下拉框中采用不同的布局
关于overridePendingTransition效果在1.6版本中会出现VerifyError的问题的解决
热门文章
Android 快速提示: 使用 System.arraycopy()(译文)
HOUSE's back!
三十而立
河蟹社会,再都无新闻日日睇,日日倾下偈了。。。陈sir 再见
生活需要简单来沉淀
五一百万葵园
HOUSE S4 COMPLETED亲戚或馀悲,他人亦已歌,死去何所道,拖体同山阿.
每个人心里都有一座巴别塔-The dogs of babel巴别塔之犬
碧海蓝天 多想为你停留。。。
重拾温暖的忆记
Copyright © 2011-2022 走看看