在WORD中如何用VBA宏语言选定一行、一段,删除一行、一段,移动光标至行首、行尾、段首、段尾等。请看以下内容。 Sub MoveToCurrentLineStart() '移动光标至当前行首 Selection.HomeKey unit:=wdLine End Sub Sub MoveToCurrentLineEnd() '移动光标至当前行尾 Selection.EndKey unit:=wdLine End Sub Sub SelectToCurrentLineStart() '选择从光标至当前行首的内容 Selection.HomeKey unit:=wdLine, Extend:=wdExtend End Sub Sub SelectToCurrentLineEnd() '选择从光标至当前行尾的内容 Selection.EndKey unit:=wdLine, Extend:=wdExtend End Sub Sub SelectCurrentLine() '选择当前行 Selection.HomeKey unit:=wdLine Selection.EndKey unit:=wdLine, Extend:=wdExtend End Sub Sub MoveToDocStart() '移动光标至文档开始 Selection.HomeKey unit:=wdStory
在WORD中用VBA实现光标移动与内容选择
最新推荐文章于 2024-09-28 12:46:54 发布