Doc to docx convert


I want to convert .doc file into .docx any one can helpme please or kindly help to use this below vba code into in invoke code anything is fine for me

   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
  End With
End With
strFile = Dir()

Set objWordDocument = Nothing
Set objWordApplication = Nothing
End Sub

Thanks in advance

@Palaniyappan @lakshman @PaulNel

1 Like

Hi @Shriharsha_H_N

Check this


Solution using command Line

"C:\Program Files\Microsoft Office\Office12\wordconv.exe" -oice -nme <input file> <output file>"

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.