I have multiple word files (more than 1500), and I want to convert them to PDF programmatically. I use the following function
public static void convertor(string filename)
{
Microsoft.Office.Interop.Word.Application appWord = new Microsoft.Office.Interop.Word.Application();
File.SetAttributes(filename, FileAttributes.Temporary);
wordDocument = appWord.Documents.Open(filename);
wordDocument.ExportAsFixedFormat(filename.ToString() + ".pdf", WdExportFormat.wdExportFormatPDF);
}
but I get the following dialog for each file
How can I unlock the files programmatically?