C#操作word,控制页脚问题

诺维斯基 2013-03-02 09:56:59
//设置页脚
appWordE.ActiveWindow.View.SeekView = WdSeekView.wdSeekCurrentPageFooter;
appWordE.Selection.HeaderFooter.LinkToPrevious = false;
appWordE.Selection.HeaderFooter.Range.ParagraphFormat.Alignment = WdParagraphAlignment.wdAlignParagraphCenter;
appWordE.ActiveWindow.ActivePane.Selection.InsertAfter("中国-");

//跳出页眉页脚设置
appWordE.ActiveWindow.View.SeekView = WdSeekView.wdSeekMainDocument;



这个可以设置一个word文档的第一页,怎么能设置第二页呢?又怎么能把所有的页都设置呢?
在网上也找了,没找到。
谢谢了。
...全文
271 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
诺维斯基 2013-03-02
  • 打赏
  • 举报
回复
xcliang2004 2013-03-02
  • 打赏
  • 举报
回复
Aspose 组件,貌似楼上写错了。
EnForGrass 2013-03-02
  • 打赏
  • 举报
回复
用appsoe.Word for Net 组件,不需要安装office组件 插入一页 Document doc = new Document("c://4add.doc"); DocumentBuilder builder = new DocumentBuilder(doc); builder.PageSetup.DifferentFirstPageHeaderFooter = true; builder.PageSetup.OddAndEvenPagesHeaderFooter = true; // Create three pages in the document. builder.MoveToSection(0); builder.Writeln("Page1"); builder.InsertBreak(BreakType.PageBreak); 参考http://blog.csdn.net/dfcj1010/article/details/6164947

110,567

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧