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
查看全文
相关阅读:
圆形按钮窗口控制-不断减少的圆圈
图像按钮和模拟Windows媒体播放器UI
圆形按钮
本机Win32主题感知所有者绘制控件没有MFC
CRegionButton -一个多向按钮
Iconits
CxShadeButton
管道符 |
gedit
more/less
原文地址:https://www.cnblogs.com/xryyforver/p/1508849.html
最新文章
【SSLOJ1715】计算面积【叉积】
【ZOJ1041】Transmitters【叉积】
【ZOJ1041】Transmitters【叉积】
【JZOJ5354】【NOIP2017提高A组模拟9.9】导弹拦截【网络流】【DP】
【JZOJ5354】【NOIP2017提高A组模拟9.9】导弹拦截【网络流】【DP】
【JZOJ5353】【NOIP2017提高A组模拟9.9】村通网【最小生成树】
【JZOJ5353】【NOIP2017提高A组模拟9.9】村通网【最小生成树】
全国计算机二级C语言考试难不难?应该怎么备考?
作为入门语言,C语言和Python哪一种更值得选择?
初学C语言,还在犹豫如何选择入门教材吗?这几本书籍建议收藏
热门文章
2020好用的C++编译器有哪些?这几款值得下载
想要避开C语言的坑,学习C语言的4种方法不容错过!
什么样的编译器才算优秀?Windows C++ 编译器应当名列前茅
先有C语言还是先有的编译器?这是一个鸡与蛋的问题
小白如何自学编程? 这些雷和坑千万不要踩!
自学C/C++,成为程序员大牛需要什么条件
做黑客需要懂几种编程语言?
XP风格CBitmapButton (CHoverBitmapButton)
圆角按钮c#
c#中的圆形按钮
Copyright © 2011-2022 走看看