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
查看全文
相关阅读:
四则运算C语言程序
雅思听听app
What is 软件工程
Python(Head First)学习笔记:六
Python(Head First)学习笔记:五
Python(Head First)学习笔记:四
Python(Head First)学习笔记:三
Python(Head First)学习笔记:二
Python(Head First)学习笔记:一
一名前端Web架构师的成长之路(转载)
原文地址:https://www.cnblogs.com/xryyforver/p/1508559.html
最新文章
windows下同时安装多个python版本的方法
Python Scrapy在windows上的安装方法
利用Python调用pastebin.com API自动创建paste
利用Python模拟登录pastebin.com
linux vi编辑器的使用
Bootstrap Table列宽拖动的方法
我眼中的闭包
Javascript定时器中的this指向
前端安全(XSS、CSRF防御)
Tomcat优化之容易集合经验
热门文章
Java设置session超时(失效)的时间
如何在同一台电脑上启动多个Tomcat服务器
Java基础常识
项目的 NuGet 程序包还原失败:找不到 “***”版本的程序
个人附加作业+期末作业附加题
软件工程个人最终总结
结对编程作业——电梯调度
实践简单的项目WC
阅读代码
VS2013软件的安装和单元测试
Copyright © 2011-2022 走看看