Output to MS Word using C#
-
My boss says... I need to create MS Word 97/2000 documents using C#. In other words, we want to use MS Word to display the output from a C# program. Things will change in the Word document like address, date, From, To and some accounting data pulled from our Oracle database. Of course, I'm a 3 month newbie to .NET & C# programming. Can anyone kick start me with some examples/code/book recommendations? I've got my "Learn C# in 21 Days" book ordered... -Larry:eek:
-
My boss says... I need to create MS Word 97/2000 documents using C#. In other words, we want to use MS Word to display the output from a C# program. Things will change in the Word document like address, date, From, To and some accounting data pulled from our Oracle database. Of course, I'm a 3 month newbie to .NET & C# programming. Can anyone kick start me with some examples/code/book recommendations? I've got my "Learn C# in 21 Days" book ordered... -Larry:eek:
Basically, what you'll need to do is use the Word OLE interface from COM interop. As a first step, in VS you add a reference to the word exe (I think) to your project, and that will give you a managed wrapper around the COM interfaces. You can also do this from the command line with tlbimp.