欢迎来到福编程网,本站提供各种互联网专业知识!

Use Word to Search for Files

发布时间:2007-06-15 作者: 来源:转载
DemonstrationscriptthatusesMicrosoftWordtolocateallthe.mp3filesstoredondriveCofthelocalcomputer复制代码代码如下:SetobjWord=CreateObject("Word.Application")SetobjDoc=objWord.Documents.Add()objWord.FileSearch.FileName="*.mp3"objWord.FileS
DemonstrationscriptthatusesMicrosoftWordtolocateallthe
.mp3filesstoredondriveCofthelocalcomputer
复制代码 代码如下:
SetobjWord=CreateObject("Word.Application")
SetobjDoc=objWord.Documents.Add()

objWord.FileSearch.FileName="*.mp3"
objWord.FileSearch.LookIn="C:"
objWord.FileSearch.SearchSubfolders=True
objWord.FileSearch.Execute

ForEachobjFileinobjWord.FileSearch.FoundFiles
Wscript.EchoobjFile
Next

objWord.Quit


相关推荐