i`m using function below to fill properly data in doc.file by bookmarks and it works good.
public void findAndReplace(Word.Document doc, object bookmark, object replaceWith)
{
Word.Range rng = doc.Bookmarks.get_Item(ref bookmark).Range;
rng.Text = replaceWith.ToString();
object oRng = rng;
doc.Bookmarks.Add(bookmark.ToString(), ref oRng);
}
I`ve got problem with setting values of choice-fields in word file. My questions is, is it even possible to set this kind of data from my c# application ? There is any method to generate Selected or unselected fields like for example in point 21 in link below or only set its value ? http://www.fotosik.pl/pokaz_obrazek/c2409113d79afeba.html
And last question is it possible and reasonable to generate whole report from doc file ?
I`m looking for some solution which helps to generate completely my declaration by c#.
Yes that is possible by programmatically adding Content Controls.
This is how you would add a Check Box Content Control:
You can generate entire documents from c#. I would suggest this tutorial from MSDN about creating templates by using content controls.