DarkMatter in Cyberspace
  • Home
  • Categories
  • Tags
  • Archives

Word中生成目录格式的VBA代码


要求在页面的最右边生成一个右对齐的制表符(以控制页码的位置),制表符的前导字符是“-”(标题与页码之间的符号),页码统一写为“A-5”,然后手工输入正确的页码。 Sub makeMenu() Selection.MoveDown Unit:=wdParagraph, Count:=1 Selection.EndKey Selection.ParagraphFormat.TabStops.Add Position:=CentimetersToPoints(15.24 _ ), Alignment:=wdAlignTabRight, Leader:=wdTabLeaderDashes Selection.TypeText Text:=vbTab Selection.TypeText Text:="A-5" End Sub



Published

Oct 12, 2008

Last Updated

Oct 12, 2008

Category

Tech

Tags

  • 格式 4
  • MS Word 6
  • 目录 4
  • VBA 8

Contact

  • Powered by Pelican. Theme: Elegant by Talha Mansoor