Sub 插入页码() ActiveDocument.PageSetup.OddAndEvenPagesHeaderFooter = False '关闭奇偶页相同(防止上回启用奇偶页不同后没有关闭此项设置) With ActiveWindow.ActivePane.View .SeekView = wdSeekCurrentPageFooter With Selection .Expand wdStory .Font.Size = 9 '字号(小五) .Font.Name = "楷书" '字体 .ParagraphFormat.Alignment = wdAlignParagraphCenter .TypeText "第" .Font.Name = "Times New Roman" '字体 .Fields.Add .Range, wdFieldPage .Font.Name = "楷书" '字体 .TypeText "页 共" .Font.Name = "Times New Roman" '字体 .Fields.Add .Range, wdFieldNumPages .Font.Name = "楷书" '字体 .TypeText "页" .ParagraphFormat.Alignment = wdAlignParagraphCenter '页码的位置居右 End With .SeekView = wdSeekMainDocument '退出页码的编辑(即关闭页眉和页脚工具栏) End With End Sub
标签:VBA,WORD,Name,字体,End,Font,页码,TypeText From: https://www.cnblogs.com/sharer/p/16931115.html