向word中插入图片 我的情况是这样的,我的图片以二进制格式存放在数据库中,如何将图片从数据库中取出,然后将图片写入word中 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 http://blog.sina.com.cn/s/blog_4acbea900100dy8j.htmlhttp://zhidao.baidu.com/question/53407792 试试 FreeTextBox 很好用 也很简单。 网上有的是源码 wordDoc = wordApp.Documents.Add(ref Nothing, ref Nothing, ref Nothing, ref Nothing); object oEndOfDoc = "\\endofdoc"; // wordApp.Selection.EndKey(ref unit, ref Nothing); // wordApp.Selection.InlineShapes.AddPicture(strImgPath, ref Nothing, ref objt, ref Nothing); Microsoft.Office.Interop.Word.Range wrdRng = wordDoc.Books.get_Item(ref oEndOfDoc).Range; Microsoft.Office.Interop.Word.InlineShape oShape; oShape = wrdRng.InlineShapes.AddPicture(strImgPath, ref Nothing, ref Nothing, ref Nothing); oShape.Width = 350f; oShape.Height = 150f; protected void addPhoto(string imgsrc, Range range) { object LinkToFile = false, SaveWithDocument = true; object Range = System.Reflection.Missing.Value; InlineShape inLineShape; String imgFile = String.Empty; imgFile = Server.MapPath(imgsrc); try { range.Text = ""; inLineShape = range.InlineShapes.AddPicture(imgFile, ref LinkToFile, ref SaveWithDocument, ref Range); inLineShape.Width = 120; inLineShape.Height = 30; } catch (Exception e) { throw; //Console.WriteLine(e.Message); } return; } 插入现有图片是这样,实在不行就把二进制存一下图片,导完了再删掉好了object yiliaofuwu = doc.Books.get_Item(ref obj_yiliaofuwu).Range;appWord.Selection.InlineShapes.AddPicture("yes.png", ref nothging, ref nothging, ref yiliaofuwu); 关于伪静态翻页问题 郁闷问题~数据连接超时 ERP管理系統中如何做領料單確認動作啊? 花瓣网图片排列是怎么实现 请问用asp.net如何上传较大一点的文件 幕白兄,那个网页自动填写的还有一个小问题 用AspNetPager怎么实现DataList分页的。 sql服务器远程连接 Can web service post data to others? 请问asp.net生成htm页面的原理是什么?最好能有个完整的例子 System.Net.Sockets.SocketException: 由于目标机器积极拒绝,无法连接。 excel模版上传问题
http://zhidao.baidu.com/question/53407792
object oEndOfDoc = "\\endofdoc";
// wordApp.Selection.EndKey(ref unit, ref Nothing);
// wordApp.Selection.InlineShapes.AddPicture(strImgPath, ref Nothing, ref objt, ref Nothing);
Microsoft.Office.Interop.Word.Range wrdRng = wordDoc.Books.get_Item(ref oEndOfDoc).Range;
Microsoft.Office.Interop.Word.InlineShape oShape;
oShape = wrdRng.InlineShapes.AddPicture(strImgPath, ref Nothing, ref Nothing, ref Nothing);
oShape.Width = 350f;
oShape.Height = 150f;
{
object LinkToFile = false, SaveWithDocument = true;
object Range = System.Reflection.Missing.Value;
InlineShape inLineShape;
String imgFile = String.Empty;
imgFile = Server.MapPath(imgsrc);
try
{
range.Text = "";
inLineShape = range.InlineShapes.AddPicture(imgFile, ref LinkToFile, ref SaveWithDocument, ref Range);
inLineShape.Width = 120;
inLineShape.Height = 30; }
catch (Exception e)
{
throw;
//Console.WriteLine(e.Message);
}
return;
}
appWord.Selection.InlineShapes.AddPicture("yes.png", ref nothging, ref nothging, ref yiliaofuwu);