600字范文,内容丰富有趣,生活中的好帮手!
600字范文 > C# word中插入页脚而不要页眉横线

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

时间:2023-11-17 14:08:47

相关推荐

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

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;//这句话去掉页眉的横线

}

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。