I’m using C# to read data from a CSV file and update the values of bookmarks in a word document. I have it working, however, I want it to open the template file, update it and save it under another name.
I used this code:
_Application word = new Application();
Document doc = word.Documents.Open(@"D:\Documents\Bookmarked.dot");
doc.Bookmarks["mybookmark"].Select();
word.Selection.TypeText("Replacement text");
((_Application)word).Quit(WdSaveOptions.wdSaveChanges, WdOriginalFormat.wdOriginalDocumentFormat);
I just don’t know how to save it under another name.
Some info and examples here:
http://msdn.microsoft.com/en-us/library/bb412305.aspx