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

C# word中插入页脚而不要页眉横线

2013-04-12 19:01 246 查看
private void InsertPageFooterNumber()

{

//插入简单页码

object oAlignment = Word.WdPageNumberAlignment.wdAlignPageNumberCenter;

object oFirstPage = true;

Word.WdHeaderFooterIndex WdFooterIndex = Word.WdHeaderFooterIndex.wdHeaderFooterPrimary;

word.Selection.Sections[1].Footers[WdFooterIndex].PageNumbers.Add(ref oAlignment, ref oFirstPage);

word.Selection.Sections[1].Footers[WdFooterIndex].Range.Font.Name = "Times New Roman";

word.Selection.Sections[1].Footers[WdFooterIndex].Range.Font.Size = 10;

word.Selection.Sections[1].Headers[WdFooterIndex].Range.ParagraphFormat.Borders[Word.WdBorderType.wdBorderBottom].LineStyle = Word.WdLineStyle.wdLineStyleNone;//这句话去掉页眉的横线

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: