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
查看全文
相关阅读:
大数据时代的艺术金融
与“数”同行:大数据驱动大学变革
与“数”同行:大数据驱动大学变革
财务信息化:大数据小时代
财务信息化:大数据小时代
Python导出DBF文件到Excel的方法
Python导出DBF文件到Excel的方法
SolrJ的入门
Spring Data Solr入门
使用solr进行配置文件
原文地址:https://www.cnblogs.com/xryyforver/p/1508849.html
最新文章
VB.NET机房收费系统总结
HTML5 Canvas 获取网页的像素值。
jQuery取得循环列表的第一列值
ANT公布SVN WEB项目到TOMCAT以及利用post-commit自己主动提交编译更新
DNS递归查询和迭代查询的差别
从博客专栏想到的数据分析
<LeetCode OJ> 100. Same Tree
MyEclipse改动内存大小
解决This function or variable may be unsafe
MSComm函数说明(来自网络)
热门文章
mfc学生成绩录入与查询
给结构体的字符数组赋值
设置电脑关机
进程间通信之剪贴板(未完)
文件操作
VM安装失败
ThinkPHP 3.2.3 自动加载公共函数文件的方法
python冒泡排序算法的实现代码
python冒泡排序算法的实现代码
大数据时代的艺术金融
Copyright © 2011-2022 走看看