mergefield

Replace MergeFields in a Word 2003 document and keep style (c#)

Hi I've been trying to create a library to replace the MergeFields on a Word 2003 document, everything works fine, except that I lose the style applied to the field when I replace it, is there a way to keep it? This is the code I'm using to replace the fields: private void FillFields2003(string template, Dictionary<string, string> v...

How to replace a section in a word template with multiple fields C#

Hi I'm creating a C# application that fills the MergeFields defined on a MS Word document with data from an external Data Source. I'm using the OpenXml SDK and everything works fine when replacing single fields. What I want to do is, to have a section with several MergeFields defined and being able to copy such section several times a...

Position cursor at start/end of Word document

We are manipulating our Word 2007 documents from .Net using Word Interop. Mostly doing stuff with fields as in: For Each f In d.Fields f.Select() //do stuff with fields here Next This leaves the last field in the document selected. So, for the sake of neatness we would like to positi...