Hi, is there any way to convert Word File to PDF file without using Word Application scope? “Invoke code” can solve this but I want to reduce the runtime even more. Is there any solution to make the automation even faster with “Invoke Code” activity to convert Word File to PDF?
P.S. I need to convert about 20k word files.
Here’s the example code,
Dim App As New Microsoft.Office.Interop.Word.Application
App.Visible = False
Dim doc As String
For Each doc In System.IO.Directory.GetFiles(InputFolder,“*.docx”)
console.WriteLine(doc)
Dim MyDoc As Microsoft.Office.Interop.Word.Document = MyApp.Documents.Open(doc.ToString)
Mydoc.SaveAs(doc.Replace(“.docx”,“.pdf”), Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatPDF)
Mydoc.Close(Microsoft.Office.Interop.Word.WdSaveOptions.wdDoNotSaveChanges)
Next
MyApp.Quit()