1

I have tried to look around for documentation on this subject, but I haven't really found a concrete answer. Just answers to problems that I am not really facing.

I want to pull some patterns and phrases from a database and generate a docx (or doc?) file in MS Word using C#. It's part of a school project. But the integration part doesn't seem to be very well documented, or I am looking in the wrong places.

Any help with this?

OmniOwl
  • 5,477
  • 17
  • 67
  • 116

3 Answers3

1

The magic word for google purposes is "Interop". Try this as a starting point:

http://www.dotnetperls.com/word

Colin Pickard
  • 45,724
  • 13
  • 98
  • 148
1

There are basically two ways to create word documents programmatically:

  • Create the documents by calling (and starting) word programmatically

  • Create the word document in the open XML format readable by Word.

For more info see similar questions here on stackoverflow: How to create word docs programmatically from a template

Community
  • 1
  • 1
Jur_
  • 302
  • 5
  • 14
0

Try use Open XML SDK 2.0 for Microsoft Office link

It provides easy way to work with docx file. After words docx format is simple zipped xml file.

Udgin
  • 119
  • 2
  • 9