Dim WshShell '定义一个变量'
Set WshShell=WScript.CreateObject("WScript.Shell") '创建一个对象'
'输入想要发送对象的备注,eg:备注为test了,此语句作用为activate名称为test的窗口'
WshShell.appactivate("test")
'执行520次循环'
for i=1 to 520
Dim Word
Set Word = CreateObject("Word.Application")
Word.Documents.Add
'拼接当前序号+我爱你,并且复制到剪切板'
Word.Selection.Text =i&"我爱你"
Word.Selection.Copy
Word.Quit False
WshShell.sendkeys "^v" '输入Ctrl + v粘贴'
WScript.Sleep 600
WshShell.SendKeys "{ENTER}" '输入回车键'
WScript.Sleep 600
next
观微博有感,如何使用代码发送520个我爱你
最新推荐文章于 2024-08-27 14:44:27 发布