Doc to docx convert

Hello,

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

Set objWordDocument = Nothing
Set objWordApplication = Nothing
End Sub

Thanks in advance

@Palaniyappan @lakshman @PaulNel

1 Like

Hi @Shriharsha_H_N

Check this

https://gallery.uipath.com/packages/UiPathTeam.FileConverter.Activities/

Thanks
Ashwin.S

Solution using command Line

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

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