提问人:Yiftach Cohen 提问时间:11/5/2023 最后编辑:braXYiftach Cohen 更新时间:11/5/2023 访问量:44
Word SelectionChange 事件
Word SelectionChange event
问:
我在 MS Word 中使用 VBA(使用 Developer => Visual Basic 选项)
我尝试捕获当我滚动到文档中的不同页面(无论是通过鼠标还是键盘)时触发的事件 我尝试使用不同的事件名称(根据我在互联网上找到的内容),但没有任何发现
Private Sub ThisDocument_SelectionChange(ByVal Sel As Selection)
' Check if the user is scrolling (i.e., changing the selection)
' and display a message box.
MsgBox "You are scrolling the document."
End Sub
Private Sub ThisDocument_WindowSelectionChange(ByVal Sel As Selection)
' Check if the user is scrolling (i.e., changing the selection)
' and display a message box.
MsgBox "You are scrolling the document."
End Sub
Private Sub Document_SelectionChange(ByVal Sel As Selection)
' Check if the user is scrolling (i.e., changing the selection)
' and display a message box.
MsgBox "You are scrolling the document."
End Sub
Private Sub Document_WindowSelectionChange(ByVal Sel As Selection)
' Check if the user is scrolling (i.e., changing the selection)
' and display a message box.
MsgBox "You are scrolling the document."
End Sub
我在这里错过了什么?
谢谢
答: 暂无答案
评论
Sub Macro1() ' ' Macro1 Macro ' ' Selection.MoveDown Unit:=wdScreen, Count:=3 Selection.MoveUp Unit:=wdScreen, Count:=2 End Sub