[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
  1. Dim word,doc,fso,fc,f
  2. Dim strBaseName,strExtName
  3. Set fso = CreateObject("Scripting.FileSystemObject")
  4. Set fc = fso.GetFolder(".").Files
  5. Set word = CreateObject("Word.Application")
  6. For Each f In fc
  7. strExtName = LCase( fso.GetExtensionName(f.Path) )
  8. If strExtName="doc" Or strExtName="docx" Then
  9. strBaseName = fso.GetBaseName(f.Path)
  10. Set doc = word.Documents.Open(f.Path)
  11. doc.SaveAs fso.GetFolder(".") & "\" & strBaseName & ".txt",7
  12. doc.Close
  13. End If
  14. Next
  15. MsgBox "转换完成"
  16. Set fso = Nothing
  17. Set fc = Nothing
  18. Set f = Nothing
  19. Set word = Nothing
  20. Set doc = Nothing
复制代码
1

评分人数

---学无止境---

TOP

返回列表