c#生成 首页页眉不同的word

wujing7390 2012-05-31 11:09:37
就是生成的word第一页没有页眉,从第二页开始页眉相同
Word._Application WordApp = new Word.Application();
//设置为不可见
WordApp.Visible = false;
//模板文件地址
object oTemplate = Server.MapPath("../../Data/Template/ReportTemp.doc");
object oDocType = Word.WdDocumentType.wdTypeDocument;
//以模板为基础生成文档
Word._Document oDoc = WordApp.Documents.Add(ref oTemplate, ref oMissing, ref oDocType, ref oMissing);
WordApp.ActiveWindow.View.Type =Word.WdViewType.wdOutlineView;
WordApp.ActiveWindow.View.SeekView =Word.WdSeekView.wdSeekPrimaryHeader;
WordApp.ActiveWindow.ActivePane.Selection.InsertAfter("编号:" + 12345+ "");
WordApp.Selection.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphRight;//设置右对齐
WordApp.ActiveWindow.View.SeekView = Word.WdSeekView.wdSeekMainDocument;//跳出页眉设置
...全文
130 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
wujing7390 2012-06-04
  • 打赏
  • 举报
回复
唉,怎么没人回答呢
wujing7390 2012-05-31
  • 打赏
  • 举报
回复
请高手帮忙看看

110,534

社区成员

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

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

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