如何用c#在word中插入图片并且使图片居中显示 看了好多帖子,实现了图片的插入,但是我想让图片居中,这个参数在哪里设置! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 1、 Microsoft.Office.Interop.Word.Application wordApp = new ApplicationClass()word对象2、 Microsoft.Office.Interop.Word.Document wordDoc = wordApp.Documents.Add(ref Nothing, ref Nothing, ref Nothing, ref Nothing) 文档对象3、 Object Nothing = System.Reflection.Missing.Value 常用的一个参数4、wordApp.ActiveWindow.ActivePane.View.SeekView = WdSeekView.wdSeekCurrentPageHeader定位到页眉5、 wordApp.Selection.ParagraphFormat. Borders[WdBorderType.wdBorderBottom].LineStyle = WdLineStyle.wdLineStyleNone去掉页眉线6、wordApp.ActiveWindow.View.SeekView = WdSeekView.wdSeekMainDocument跳出页眉7、 wordApp.Selection.ParagraphFormat.Alignment = WdParagraphAlignment.wdAlignParagraphCenter对齐方式(此为居中)8、 Microsoft.Office.Interop.Word.Table policyTab = wordDoc.Tables.Add(wordApp.Selection.Range, 行数, 列, ref Nothing, ref Nothing);创建表格9、 wordApp.Selection.GoTo(ref oGoToItem, ref oGoToLast, ref Nothing, ref Nothing);定位页面(此为将光标定位到内容的最后)10、 wordApp.Selection.InsertBreak(ref Nothing);插入分节符11、 wordApp.Selection.InsertFile(nofile, ref Nothing, ref contenFalse, ref contenFalse, ref contenFalse);插入文件12、 wordApp.Selection.InlineShapes.AddPicture(picName, ref LinkToFile, ref SaveWithDocument, ref Nothing);插入图片13、 wordApp.ActiveWindow.ActivePane.View.SeekView = WdSeekView.wdSeekCurrentPageFooter;定位到页脚14、 wordApp.Selection.TypeText("此处写需要在指定位置输出的文字");文本输入15、 wordDoc.ComputeStatistics(WdStatistic.wdStatisticPages, ref Nothing);得到页码16、 wordDoc.PrintOut(ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing);调用打印机实现打印(调用的是默认打印机)17、 wordDoc.Close(ref saveChanges, ref Nothing, ref Nothing);文档退出18、 wordApp.Quit(ref Nothing, ref Nothing, ref Nothing);word程序退出 http://www.pconline.com.cn/pcedu/empolder/gj/vc/10305/168480.html 德州扑克 用C# 牌型判断,有谁写过呀 [疑问]垃圾回收、托管堆、栈的涵义 一个初级问题 50元人民币求助,用C# managed directx显示3ds文件,顶者有分 求满足要求的正则表达式 关于产生随机序列 连接 数据库 不上——求搭救 C# 使用com的OfficeViewer OCX组件时 提示没有注册类 [c#]如何移除 form右上角的x钮,只留下放大跟缩小钮。 请问各位out string做参数为什么会崩溃,谢谢 C# 定位comboBox光标的位置 定位到这个控件文本的最后一个字符后面。 关于多线程问题请教!
7、 wordApp.Selection.ParagraphFormat.Alignment = WdParagraphAlignment.wdAlignParagraphCenter对齐方式(此为居中)
8、 Microsoft.Office.Interop.Word.Table policyTab = wordDoc.Tables.Add(wordApp.Selection.Range, 行数, 列, ref Nothing, ref Nothing);创建表格9、 wordApp.Selection.GoTo(ref oGoToItem, ref oGoToLast, ref Nothing, ref Nothing);定位页面(此为将光标定位到内容的最后)10、 wordApp.Selection.InsertBreak(ref Nothing);插入分节符11、 wordApp.Selection.InsertFile(nofile, ref Nothing, ref contenFalse, ref contenFalse, ref contenFalse);插入文件12、 wordApp.Selection.InlineShapes.AddPicture(picName, ref LinkToFile, ref SaveWithDocument, ref Nothing);插入图片13、 wordApp.ActiveWindow.ActivePane.View.SeekView = WdSeekView.wdSeekCurrentPageFooter;定位到页脚14、 wordApp.Selection.TypeText("此处写需要在指定位置输出的文字");文本输入15、 wordDoc.ComputeStatistics(WdStatistic.wdStatisticPages, ref Nothing);得到页码16、 wordDoc.PrintOut(ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing);调用打印机实现打印(调用的是默认打印机)17、 wordDoc.Close(ref saveChanges, ref Nothing, ref Nothing);文档退出18、 wordApp.Quit(ref Nothing, ref Nothing, ref Nothing);word程序退出