|
Option Explicit
Public Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Sub 将文本发送到企业微信1()
Dim Name As String, Msg As String
Dim WS As Object
Dim arr As Variant, i As Long
Set WS = CreateObject("wscript.shell")
arr = Sheet12.Range("A1").CurrentRegion
For i = 2 To UBound(arr)
Name = arr(i, 2)
Msg = "3"
WS.SendKeys "+%s"
Sleep 999
WS.Run "mshta vbscript:ClipboardData.SetData(" & Chr(34) & "text" & Chr(34) & "," & Chr(34) & Name & Chr(34) & ")(close)", 0, True
Sleep 999
WS.SendKeys "^f"
Sleep 1299
WS.SendKeys "^v"
Sleep 1299
WS.SendKeys "{ENTER}"
Sleep 999
WS.Run "mshta vbscript:ClipboardData.SetData(" & Chr(34) & "text" & Chr(34) & "," & Chr(34) & Msg & Chr(34) & ")(close)", 0, True
Sleep 999
WS.SendKeys "^v"
Sleep 999
WS.SendKeys "{ENTER}"
Next i
Set WS = Nothing
End Sub
|
|