110,577
社区成员
发帖
与我相关
我的任务
分享
Microsoft.Office.Interop.Word.Application oDoc = new Microsoft.Office.Interop.Word.Application();
object LinkToFile = false;
object SaveWithDocument = true;
object Left = 50;//插入点相对距离
object Top = 50;//插入点相对距离
object Width = 86;//图片宽
object Height = 85;//图片高
object tmp1 = null;
string fileName = @"../Images/youte.bmp";
oDoc.Application.ActiveDocument.Shapes.AddPicture(fileName,ref LinkToFile,ref SaveWithDocument, ref Left, ref Top, ref Width, ref Height, ref tmp1);
//插入图片
object Range = System.Reflection.Missing.Value;
appWord.Selection.ParagraphFormat.Alignment = WdParagraphAlignment.wdAlignParagraphRight;
appWord.Selection.InlineShapes.AddPicture(HostingEnvironment.ApplicationPhysicalPath + @"Images\Logo\"+dt1.Rows[0]["dLogo"]+"", ref oMissing, ref oMissing, ref Range);
//插入图片
object Range = System.Reflection.Missing.Value;
appWord.Selection.ParagraphFormat.Alignment=WdParagraphAlignment.wdAlignParagraphRight;
appWord.Selection.InlineShapes.AddPicture(HostingEnvironment.ApplicationPhysicalPath + @"Images\Logo\"+dt1.Rows[0]["dLogo"]+"", ref oMissing, ref oMissing, ref Range);
Microsoft.Office.Interop.Word.Application oDoc = new Microsoft.Office.Interop.Word.Application();
object LinkToFile = false;
object SaveWithDocument = true;
object Left = 50;//插入点相对距离
object Top = 50;//插入点相对距离
object Width = 86;//图片宽
object Height = 85;//图片高
object tmp1 = null;
string fileName = @"../Images/youte.bmp";
oDoc.Application.ActiveDocument.Shapes.AddPicture(fileName,ref LinkToFile,ref SaveWithDocument, ref Left, ref Top, ref Width, ref Height, ref tmp1);
//bs是读出的二进制数据
byte[] bs = (byte[])read["文件"];
MemoryStream ms = new MemoryStream(bs);
Image img = Image.FromStream(ms);