2000字范文,分享全网优秀范文,学习好帮手!
2000字范文 > [FUNC]Word页脚插入页码 删除页眉横线

[FUNC]Word页脚插入页码 删除页眉横线

时间:2021-01-22 09:54:53

相关推荐

[FUNC]Word页脚插入页码 删除页眉横线

Word插入页脚,删除页眉横线

;作者:sunwind1576157;时间:12月3日;最新版网址:/liuyukuan/article/details/103369405;功能:利用Word.Application COM对象,操纵word插入页脚,并删除页眉中的横线;参数:第一个参数标识页码位置、第二个参数是首页是否插入页码。F7::InsertPageNumber("Center", true)returnInsertPageNumber(strType, bHeader){;word常数参考 /boards/viewtopic.php?f=22&t=1672;~ WdPageNumberAlignment 5 members.wdAlignPageNumberLeft := 0wdAlignPageNumberCenter := 1wdAlignPageNumberRight := 2wdAlignPageNumberInside := 3wdAlignPageNumberOutside := 4;~ WdHeaderFooterIndex 3 members.wdHeaderFooterPrimary:= 1wdHeaderFooterFirstPage := 2wdHeaderFooterEvenPages := 3;~ WdBorderType 8 members.wdBorderTop := -1wdBorderLeft := -2wdBorderBottom = -3wdBorderRight := -4wdBorderHorizontal := -5wdBorderVertical := -6wdBorderDiagonalDown := -7wdBorderDiagonalUp := -8;~ WdLineStyle 25 members.wdLineStyleNone := 0wdLineStyleSingle := 1wdLineStyleDot := 2;...oWordApplic:=ComObjActive("Word.Application")oAlignment := wdAlignPageNumberCenteroFirstPage := bHeaderWdFooterIndex:=wdHeaderFooterPrimaryswitch strType{case "Center":oAlignment := wdAlignPageNumberCentercase "Right":oAlignment := wdAlignPageNumberRightcase "Left":oAlignment := wdAlignPageNumberLeft};.Item(1)改成[1];.Item(WdFooterIndex)改成[WdFooterIndex]oWordApplic.Selection.Sections[1].Footers[WdFooterIndex].PageNumbers.Add(oAlignment,oFirstPage)oWordApplic.Selection.Sections[1].Footers[WdFooterIndex].Range.Font.Name := "Times New Roman"oWordApplic.Selection.Sections[1].Footers[WdFooterIndex].Range.Font.Size := 14;去掉页眉的横线 ,如oFirstPage=false时 首页的横线去不掉的。oWordApplic.Selection.Sections[1].Headers[WdFooterIndex].Range.ParagraphFormat.Borders[wdBorderBottom].LineStyle := wdLineStyleNone}

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