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
查看全文
相关阅读:
html HTML 文本格式化
纯css3实现图片切换
绝对路径和相对路径
CSS设置html网页背景图片 CSS设置网页背景颜色
使用CSS3制作响应式网页背景图像
CSS背景全攻略
HTML中通过CSS设置背景图片自适应浏览器大小
CSS设置背景——图片背景
如何让图片自适应手机等移动设备屏幕大小
SERVER 2012 R2 对域用户禁用移动存储设备
原文地址:https://www.cnblogs.com/xryyforver/p/1508559.html
最新文章
Jenkins+git+Nginx
linux命令提示符设置
转 Git 常用命令大全
转 ssh-keygen 的 详解
转 git config命令使用
linux中启动 java -jar 后台运行程序
linux下端口占用
windows下端口占用
vscode输出窗口中文乱码
JVM启动参数详解
热门文章
map2bean & bean2map
消息队列手动确认Ack
Git 修改已提交的commit注释
MnogoDB唯一索引,稀疏索引
终论到底该不该写isDebugEnabled
create-react-app关闭eslint提醒
前端推荐框架bootstrap
关于left:50%的应用技巧
css !important
前端程序员:月薪5K到5万,我干了啥
Copyright © 2011-2022 走看看