- 帖子
- 127
- 主題
- 56
- 精華
- 0
- 積分
- 176
- 點名
- 0
- 作業系統
- win8
- 軟體版本
- office2003
- 閱讀權限
- 20
- 註冊時間
- 2013-1-24
- 最後登錄
- 2025-1-26
|
17#
發表於 2015-8-14 16:09
| 只看該作者
Public Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long
Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) 'For 32 Bit Systems
Public Function Orderfunction(neworder As Integer, oldorder As Integer) As Integer
Dim myKey As Object
Set myKey = CreateObject("WScript.Shell")
a = SetCursorPos(20, 430) '移動至Line對話視窗
mouse_event 2, 0, 0, 0, 0 '下壓左滑鼠
mouse_event 4, 0, 0, 0, 0 '放鬆左滑鼠
Sleep (500)
myKey.SendKeys "Hello, I'm VBA message"
Sleep (500)
myKey.SendKeys "{ENTER}"
Sleep (500)
myKey.SendKeys "{ENTER}"
Sleep (500)
小弟用最愚笨的方法寫的,請笑納!! |
|