我正在尝试列出所有可见的窗口(名称和顶部)。我的脚本运行良好,但需要安装 Microsoft Word。要执行我的脚本,您可以运行此命令
Cscript -B myScript.vbs
muScript.vbs:
Dim console
Set console = WScript.StdOut
Dim myString
myString = ""
Set Word = CreateObject("Word.Application")
Set Tasks = Word.Tasks
Set colTasks = Word.Tasks
For Each Task in Tasks
If Task.Visible Then
If colTasks.Exists(Task.Name) Then
myString = myString & "@@##@@" & colTasks(Task.Name).Name & ","& colTasks(Task.Name).Top
End If
End If
Next
Word.Quit
console.WriteLine myString
您知道如何在不安装 Microsoft Word 的情况下列出可见窗口,例如 myScript.vbs 吗?
非常感谢