这个试下$folder=FileSelectFolder("请选择文本所在目录","")
If @error Then Exit 0
If StringRight($folder,1)<>"" Then $folder&=""
$file=FileFindFirstFile($folder&"\*.doc?")
$wordapp=ObjCreate("word.application")
$wordapp.visible=False
While 1
$currentfile=FileFindNextFile($file)
If @error Then ExitLoop
$currentfile=$folder&$currentfile
If StringRegExp(StringLower($currentfile),"\.doc.$",0)=1 Then
$wd=$wordapp.documents.open($currentfile)
$wd.saveas2(StringLeft($currentfile,StringLen($currentfile)-1),0)
$wd.close
EndIf
WEnd
FileClose($file)
$wordapp.quit
$wordapp=Null
MsgBox(0,"提示","所选目录转换完成!",5)
|