再补充一些关于C#动态生成Word文档的操作
WordDoc.PageSetup.Orientation = Word.WdOrientation.wdOrientLandscape;//页面设置为横向
WordApp.Selection.ParagraphFormat.SpaceAfter = 10f;//段后距离
WordApp.Selection.TypeText("产品材料表");//在光标处写入信息
//插入图片 方法2
string FileName = Picture;
object LinkToFile = false;
object SaveWithDocument = true;
object Anchor = WordDoc.Tables[1].Cell(7, p).Range;//设置插入位置 // WordDoc.Application.Selection.Range;
object Left = 5;
object Top = 5;
object Width = 90;
object Height = 90;
WordDoc.Application.ActiveDocument.Shapes.AddPicture(FileName, ref LinkToFile, ref SaveWithDocument,ref Left,ref Top,ref Width,ref Height, ref Anchor);
WordApp.Selection.ParagraphFormat.SpaceAfter = 10f;//段后距离
WordApp.Selection.TypeText("产品材料表");//在光标处写入信息
//插入图片 方法2
string FileName = Picture;
object LinkToFile = false;
object SaveWithDocument = true;
object Anchor = WordDoc.Tables[1].Cell(7, p).Range;//设置插入位置 // WordDoc.Application.Selection.Range;
object Left = 5;
object Top = 5;
object Width = 90;
object Height = 90;
WordDoc.Application.ActiveDocument.Shapes.AddPicture(FileName, ref LinkToFile, ref SaveWithDocument,ref Left,ref Top,ref Width,ref Height, ref Anchor);