Sub TranslateDocIntoDocx() Dim objWordApplication As New Word.Application Dim objWordDocument As Word.Document Dim strFile As String Dim strFolder As String
strFolder = "E:\Temp\" strFile = Dir(strFolder & "*.doc", vbNormal) While strFile <> "" With objWordApplication Set objWordDocument = .Documents.Open(FileName:=strFolder &strFile, AddToRecentFiles:=False, ReadOnly:=True, Visible:=False) With objWordDocument .SaveAs FileName:=strFolder & Replace(strFile, "doc", "docx"), FileFormat:=16 .Close EndWith EndWith strFile = Dir() Wend
Set objWordDocument = Nothing Set objWordApplication = Nothing EndSub