Use Word to Search for Files_javascript技巧
程序员文章站
2022-05-31 19:33:50
...
Demonstration script that uses Microsoft Word to locate all the
.mp3 files stored on drive C of the local computer
Set objWord = CreateObject("Word.Application")
Set objDoc = objWord.Documents.Add()
objWord.FileSearch.FileName = "*.mp3"
objWord.FileSearch.LookIn = "C:\"
objWord.FileSearch.SearchSubfolders = True
objWord.FileSearch.Execute
For Each objFile in objWord.FileSearch.FoundFiles
Wscript.Echo objFile
Next
objWord.Quit
.mp3 files stored on drive C of the local computer
复制代码 代码如下:
Set objWord = CreateObject("Word.Application")
Set objDoc = objWord.Documents.Add()
objWord.FileSearch.FileName = "*.mp3"
objWord.FileSearch.LookIn = "C:\"
objWord.FileSearch.SearchSubfolders = True
objWord.FileSearch.Execute
For Each objFile in objWord.FileSearch.FoundFiles
Wscript.Echo objFile
Next
objWord.Quit
上一篇: wordpress.com 使用WordPress搭建自己的博客
下一篇: 接前代码_PHP教程