Word2003被退休了,以前做的文档都是DOC的,肿么办?


Word2003被退休了,以前做的文档都是DOC的,现在都要转成DOCX,一个一个转,那样是不是2X青年的标准做法?

不要2!

来看下魔术青年是如何搞定的~~

Sub Sample()
Dim MyPath As String
Dim MyDmN As String
Dim MyDoc
Application.DisplayAlerts = False
MyPath = InputBox("请输入待转换文档所在的文件夹路径:" & Chr(10) & "(转换后的文件将被保存在此文件夹下的NEW文件夹内,请确保没有重名的文件夹存在。)", "", ThisDocument.Path)
MkDir MyPath & "/NEW"
MyDmN = Dir(MyPath & "\*.doc")
Do While MyDmN <> ""
    If MyDmN <> ThisDocument.Name Then
       If Right(MyDmN, 4) <> "docx" Then
           Documents.Open FileName:=MyPath & "\" & MyDmN
           ActiveDocument.SaveAs2 FileName:=MyPath & "\NEW\" & MyDmN & "x", FileFormat:=wdFormatXMLDocument, CompatibilityMode:=15
           Documents(MyDmN & "x").Close
       End If
    End If
    MyDmN = Dir
Loop
MsgBox "转换成功,保存在" & MyPath & "\NEW文件夹内。" & Chr(10) & "为防止同名被覆盖,原文件夹中已有docx文档未作任何转换与移动。"
Application.DisplayAlerts = True
End Sub