‘
Selection.MoveDown Unit:=wdLine, Count:=1'光标下移一行
’选中光标所在行
With Selection
.HomeKey Unit:=wdLine, Extend:=wdExtend
.MoveEnd Unit:=wdLine, Count:=1
End With
移动光标至文档开始
Selection.HomeKey unit:=wdStory
下面的供参考:
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
End Sub
Sub MoveToDocEnd()
'移动光标至文档结尾
Selection.EndKey