Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
- End With
- End With
- strFile = Dir()
- Wend
- Set objWordDocument = Nothing
- Set objWordApplication = Nothing
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement