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
查看全文
相关阅读:
匿名内部类详解
成员内部类详解
内部类
局部内部类详解
switch
Enum 类型
循环
标号
软件开发模型
RUP
原文地址:https://www.cnblogs.com/xryyforver/p/1508559.html
最新文章
NHibernate 组件基础 (第六篇)
NHibernate 映射基础(第三篇) 简单映射、联合主键
NHibernate 数据查询之Linto to NHibernate (第八篇)
ArcMap VBA实现连续编号
Windows平台下使用CodeBlocks+GCC编译器生成动态dll,C#调用报错
GDAL 地图切片层级计算公式
基于 MBTiles 规范扩展的缓存文件格式说明
支持 MBTiles 规范的预缓存
MBTiles地图瓦片管理工具
Image.FromFile 方法锁住文件解决方法
热门文章
devexpress GridControl 行指示列图标绘制
WampServer
web服务器--apache
web服务器--nginx简介
什么是WEB服务器?
计算机无法连接网络,查找计算机网络问题
数字签名和对称以及非对称加密过程
python 3.0读取文件出现编码错误(illegal multibyte sequence )
MySQL:比较两个数据表不同部分
mysql 导入txt数据
Copyright © 2011-2022 走看看