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
查看全文
相关阅读:
mac下免费的动态截屏制图工具:kap
ssh端口转发实现socket5代理上网
Linux上查看node和node_modules所在位置
elasticsearch索引和快照清理:es curator
npm运行报错:Error: ENOSPC: System limit for number of file watchers reached
第二章 : 微服务环境搭建
第一章 :微服务的架构介绍发展
超简单的 Docker部署 SpringBoot项目 步骤
maven继承父工程统一版本号
Maven史上最全的pom.xml详解
原文地址:https://www.cnblogs.com/xryyforver/p/1508559.html
最新文章
Docker 简介
实用指令
用户管理
开机、重启和用户登录注销
vi 和 vim 编辑器
HttpClient
MySQL 分页查询
AlibabaCloud 核⼼组件配置中心 Nacos 实战
AlibabaCloud 核⼼组件链路追踪 Sleuth 和 zipking 实战
Fetch |介绍及使用Fetch发送请求
热门文章
xhr |XMLHttpRequest是什么?
axios |介绍及应用
vuecli基础应用
vue |实现点击图片预览浏览器满屏大图
vue |通过swiper实现动态数据的简单轮播
Git的基本知识及应用
vue-router基本使用
rocketmq线上集群性能优化:异步刷盘与异步复制
rocketmq性能调优:broker快速失败判断maxWaitTimeMillsInQueue
ansible远程执行shell报错:command not found
Copyright © 2011-2022 走看看