[AHK]Excel 怎么使用鼠标滚轮控制表格左右移动

 

ahk 是否可以设置 在excel里 按着 shiit 在用滚轮 进行 下面的滚轮拖动动作?

 

#IfWinActive,ahk_exe EXCEL.EXE
~Shift & WheelUp::  ; 向左滚动.
	SetScrollLockState, On
	Send {Left}
	SetScrollLockState, off
return

~Shift & WheelDown::  ; 向右滚动.
	SetScrollLockState, On
	Send {Right}
	SetScrollLockState, off
return
#IfWinActive

更好的版本

#IfWinActive,ahk_exe EXCEL.EXE
 ~LShift & WheelUp::  ; Scroll left.
 ControlGetFocus, fcontrol, A
 Loop 5  ; <-- Increase or decrease this value to scroll faster or slower.
    ComObjActive("Excel.application").ActiveWindow.SmallScroll(0,0,0,1)
 return

 ~LShift & WheelDown::  ; Scroll right.
 ControlGetFocus, fcontrol, A
 Loop 5  ; <-- Increase or decrease this value to scroll faster or slower.
 	ComObjActive("Excel.application").ActiveWindow.SmallScroll(0,0,1,0)
 return
#IfWinActive

如果控制word请用ComObjActive("Word.application").。。。。

你可能感兴趣的:(AutoHotkey,热键,Excel)