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
查看全文
相关阅读:
js防止按钮被多次点击
jQuery:localStorage用法
jQuery Ajax 前端和后端数据交互的问题
<img>总结: 动态创建等问题
jQuery
Echarts 饼图(series)标题文字太长的换行设置
echarts 为x轴、y轴添加滚动条
video.js的应用
关于跨域问题的详解
麻省理工18年春软件构造课程阅读04“代码评审”
原文地址:https://www.cnblogs.com/xryyforver/p/1508559.html
最新文章
motan源码分析六:客户端与服务器的通信层分析
motan源码分析五:cluster相关
motan源码分析四:客户端调用服务
motan源码分析三:与spring框架的结合
motan源码分析二:使用spi机制进行类加载
motan源码分析一:服务发布及注册
lesson9:分布式定时任务
lesson4:使用锁Lock来解决重复下单的问题
Lesson2.1:LinkedList、ConcurrentLinkedQueue、LinkedBlockingQueue对比分析
nginx ssl pathinfo 伪静态 301 配置文件
热门文章
Linux phpmailer发送邮件失败的解决方法
wdcp v3 pureftpd 无法登录问题解决
Mysql慢查询开启和查看 ,存储过程批量插入1000万条记录进行慢查询测试
Mysql是否开启binlog日志&开启方法
redis 带入的挖矿病毒 qW3xT.2 wnTKYg 解决方法
php GD图片四角圆形处理
php 微信客服信息推送失败 微信重复推送客服消息 40001 45047
php GD 圆图 -处理成圆图片
linux wdcp3 上传大文件 服务器i/o错误
css自定义滚动条样式
Copyright © 2011-2022 走看看