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
查看全文
相关阅读:
Fortran编译器之一GUN Fortran安装(Windows XP)
c++动态绑定的技术实现
c++标准库比较
java array
java常用的基础容器
mac sublime text 3 add ctags plugin
git fetch
查看远程分支的log
git删除分支
detached HEAD state
原文地址:https://www.cnblogs.com/xryyforver/p/1508849.html
最新文章
【BZOJ3631】松鼠的新家 树链剖分
【NOI2011】道路修建 BFS
初中 光学1
初中物理 电
初中物理 电功
行测 题型
以身作则 如履薄冰
大而化之
世俗化
第四次工业革命
热门文章
亚吉铁路
蒙内铁路
Airplace平台
制作一个导航卫星绕地球转动的3D Flash动画
室内定位
Android基础
浮点型转整数型进行计算
OpenGL学习
Eclipse添加servlet-api.jar库的引用
VS2008 + QGIS1.7.1试验
Copyright © 2011-2022 走看看