Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. using Word = Microsoft.Office.Interop.Word;
  2.  
  3. Word.Application wordApp = new Word.Application();
  4. Word.Document doc = null;
  5.  
  6. // open the template file
  7. doc = wordApp.Documents.Open(templateFileName, Type.Missing, bReadOnly);
  8. doc.MailMerge.OpenDataSource(dataSourceFileName);
  9. // Perform mail merge.
  10. doc.MailMerge.Destination = Word.WdMailMergeDestination.wdSendToNewDocument;
  11. doc.MailMerge.Execute();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement