您的位置:首页 > 编程语言 > C#

[C#]用C#动态生成Word文档并将数据填入Word表格中(续)

2007-04-25 15:56 816 查看
再补充一些关于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);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: