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
查看全文
相关阅读:
React Native 架构演进
React Native 架构一览
React Native 在 Airbnb 的起起落落
React Native简史
图解云服务模型的演进
伯克利研究员们眼中的Cloud Computing
彻底理解 IaaS、PaaS、SaaS
JS更随机的随机数
JS自动化
fingerprint2 计算浏览器指纹分析
原文地址:https://www.cnblogs.com/xryyforver/p/1508849.html
最新文章
深度剖析短视频分发过程中的用户体验优化技术点
作为开发者,视频的生产、分发和消费三大环节,你该在意什么?
蜂鸟E203系列——Windows开发工具
蜂鸟E203系列——Linux调试(GDB+Openocd)
蜂鸟E203系列——Linux下运行hello world例程
蜂鸟E203系列——嵌入式软件环境
蜂鸟E203系列——FPGA硬件环境
蜂鸟E203系列——Linux开发工具
蜂鸟E203系列——RISC-V资料
RISC-V发展现状
热门文章
视频相关书籍
MIPI CSI-2
重新理解JS的6种继承方式
前端优化:雅虎35条
TC39规范制定流程
ES11来了,还学得动吗?
ES6 Proxy 在 Immer 中的妙用
理想的JavaScript不可变数据结构
为什么需要云IDE?
1000 千米高空俯瞰 React Native
Copyright © 2011-2022 走看看