110,571
社区成员
发帖
与我相关
我的任务
分享
//移动焦点并换行
object count = 5;
object WdLine = Microsoft.Office.Interop.Word.WdUnits.wdLine;//换一行;
WordApp.Selection.MoveDown(ref WdLine, ref count, ref Nothing);//移动焦点 WordApp.Selection.TypeParagraph();//插入段落
WordApp.Selection.PageSetup.Orientation = Microsoft.Office.Interop.Word.WdOrientation.wdOrientLandscape;
object endLocation = WordDoc.Content.End;
object startLocation = WordDoc.Content.Start;
Microsoft.Office.Interop.Word.Range rng = WordDoc.Range(ref startLocation, ref endLocation);
rng.Font.Size = 8;
rng.Font.Name = "Arial";
rng.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter;
rng.Select();
List<string> listtr = new List<string>();
#region 152
//文档中创建表格
Microsoft.Office.Interop.Word.Table newTable = WordDoc.Tables.Add(WordApp.Selection.Range, RetDtCount(dtwljg, "152") + 1, 10, ref Nothing, ref Nothing);
//设置表格样式
newTable = SetTableSytel(newTable);
//填充表格内容
listtr = Pustlist152(listtr);
newTable = CreateBody(newTable, dtwljg, listtr, "152");
Word.Application WordApp = new Word.ApplicationClass();
using Word = Microsoft.Office.Interop.Word;
Word.Document WordDoc = WordApp.Documents.Add(ref Nothing, ref Nothing, ref Nothing, ref Nothing);
WordDoc.Content.InsertBefore("学生成绩表");