Programmatically generate MS Word files using Interop in .Net Core

Target audience: c#
Used tools: c#, .Net Core
What’s the purpose: Programmatically generate MS Word files using Interop in .Net Core

Well, I need an app to make Word files with data from Excel file.
Searching in internet a find this tutorial:

https://dottutorials.net/programmatically-generate-word-files-using-interop-in-net-core/

If i have to ‘rate’ it – the rating will be ‘Wow’ !
At the end you can find link to code :

https://github.com/shehryarkn/Programmatically-generate-Microsoft-Word-files-Using-Microsoft-Office-Interop

But it was from January 23, 2020. Download and install in VS 2019 Community Ed. And boom : Microsoft.Office.Interop.Word.dll is not supported on my PC. The PC where was installed app was with Win 10, MS Office 365 and .NET Core 3.1

So, you have the following :

  1. In VS 2019, go to Solution Explorer and remove a reference to Microsoft.Office.Interop.Word.dll file
  2. Right-click on References and select Add Reference
  3. Click the COM tab
  4. Select Microsoft Word 16.0 Object Library and click OK

Then, in Dependencies you can see added COM -> Interop.Microsoft.Office.Interop.Word

And here how this looks like :

Now you can compile without error !