populating word doc from xml in c#

Posted by shdu1 on Stack Overflow See other posts from Stack Overflow or by shdu1
Published on 2011-01-14T13:29:40Z Indexed on 2011/01/14 13:53 UTC
Read the original article Hit count: 129

Filed under:
|
|

how do i populate a word doc from an xml template using c#. I know how to open a blank document but I cant figure out how to populate it.

Word.Document wordDoc = wordApp.Documents.Add(ref objMissing,
             ref objMissing, ref objMissing, ref objMissing);
Word.Paragraph wordParagraph = wordDoc.Paragraphs.Add(ref objMissing);

Here's a basic look at my xml form.

<?xml version="1.0" encoding="utf-8"?>
<Cover>
  <CaseNo>Case No:</CaseNo>
  <Title>Title:</Title>
  <Date>Date:</Date>
</Cover>

What I eventually want to do is get the user to fill in textboxes in a c# program which will populate the word document.

PLEASE HELP ME!!! I've been trying to figure this out for days

Note the information is not coming from an sql database

© Stack Overflow or respective owner

Related posts about c#

Related posts about Xml