随笔分类 -  VBA

word中手动插入页码域的方法
摘要:在word文件中,需要插入特定内容所在页码,且要求页码能随特定内容所在位置自动更新。可以通过上述VBA的方式实现,也可手动实现: 首先,在特定内容所在位置插入书签,为书签取名如s1 其次,在需要插入动态页码的地方按Ctrl+F9,添加域,在域括号上点击右键,选择编辑域,弹出域类型选择框,选择page 阅读全文

posted @ 2020-12-04 10:19 mol1995 阅读(2174) 评论(0) 推荐(0)

WordVBA常用项
摘要:将光标所在段落选中 Selection.MoveUp unit:=wdParagraphSelection.MoveDown unit:=wdParagraph, Extend:=wdExtend ' 选择当前行 Selection.HomeKey unit:=wdLine Selection.En 阅读全文

posted @ 2019-03-14 17:29 mol1995 阅读(393) 评论(0) 推荐(0)

根据段落编号自动添加书签的VBA
摘要:Sub 宏1() ' ' 宏1 宏 ' ' Dim myRange As Word.Range Dim num As String, content As String Selection.HomeKey Unit:=wdLine Selection.EndKey Unit:=wdLine, Ext 阅读全文

posted @ 2018-09-24 09:07 mol1995 阅读(670) 评论(0) 推荐(0)

导航