Microsoft.Office.Interop.Word.Application word = null;Microsoft.Office.Interop.Word.Document d = null;try {
Microsoft.Office.Interop.Word.Application word = null;Microsoft.Office.Interop.Word.Document d = null;try
{
word = new Microsoft.Office.Interop.Word.Application();word.DisplayAlerts = Microsoft.Office.Interop.Word.WdAlertLevel.wdAlertsNone;word.Visible = true;d = word.Documents.Open(source);d.ExportAsFixedFormat(pdf, WdExportFormat.wdExportFormatPDF, false, WdExportOptimizeFor.wdExportOptimizeForPrint,WdExportRange.wdExportAllDocument, 1, 1, WdExportItem.wdExportDocumentContent, false, true,WdExportCreateBookmarks.wdExportCreateNoBookmarks, true, true, false);
word = new Microsoft.Office.Interop.Word.Application();
word.DisplayAlerts = Microsoft.Office.Interop.Word.WdAlertLevel.wdAlertsNone;
word.Visible = true;
d = word.Documents.Open(source);
d.ExportAsFixedFormat(pdf, WdExportFormat.wdExportFormatPDF, false, WdExportOptimizeFor.wdExportOptimizeForPrint,
WdExportRange.wdExportAllDocument, 1, 1, WdExportItem.wdExportDocumentContent, false, true,
WdExportCreateBookmarks.wdExportCreateNoBookmarks, true, true, false);
}catch (COMException ex){
}
catch (COMException ex)
Console.WriteLine("ERR > " + ex.Message + "\n" + ex.StackTrace);