Created
February 25, 2021 16:23
-
-
Save awright18/fc92ac7bd1e94bdc5b45b4524ad73628 to your computer and use it in GitHub Desktop.
Word To Pdf Conversion - Using Microsoft.Office.Interop.Word
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.Office.Interop.Word; | |
namespace Word2Pdf | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Application appWord = new Application(); | |
var wordDocument = appWord.Documents.Open(@"c:\users\awright2\desktop\imaword.docx",ReadOnly:true); | |
wordDocument.ExportAsFixedFormat(@"c:\users\awright2\desktop\imapdf.pdf", WdExportFormat.wdExportFormatPDF, OpenAfterExport:false); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment