110,530
社区成员
发帖
与我相关
我的任务
分享
//插入图片
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);
//插入图片
if (p1 == 0)
{
string FileName = @"C:\22.bmp";//图片所在路径
object LinkToFile = false;
object SaveWithDocument = true;
object Anchor = tab.Cell(1, 5).Range;//指定图片插入的区域
//将图片插入到单元格中
tab.Cell(1, 5).Range.InlineShapes.AddPicture(FileName, ref LinkToFile, ref SaveWithDocument, ref Anchor);
}
wordApp.Selection.ParagraphFormat.Alignment = WdParagraphAlignment.
wdAlignParagraphCenter对齐方式(此为居中)