【发布时间】:2019-03-11 10:38:59
【问题描述】:
我正在尝试将横向页面插入 Word 文档。但它将所有页面更改为横向。如何在我的 word 文档中只插入一个横向页面?
我的代码:
object wdSectionBreakNextPage = 2;
//object pageBreak = 7; //el 7 es el tipo. https://docs.microsoft.com/en-us/dotnet/api/microsoft.office.interop.word.wdbreaktype?view=word-pia
rngDoc.Select();
//rngDoc.InsertBreak(pageBreak);
rngDoc.InsertBreak(wdSectionBreakNextPage);
rngDoc.PageSetup.Orientation = WdOrientation.wdOrientLandscape;
rngDoc.PageSetup.DifferentFirstPageHeaderFooter = 0;
Microsoft.Office.Interop.Word.Paragraph para = rngDoc.Paragraphs.Add();
para.Range.InsertParagraphAfter();
【问题讨论】:
标签: c# ms-word office-interop landscape