private void PopulateClientTemplate(KeyValuePair <string, string> templateNameAndfileSaveName) { toolStripStatusLabel1.Text = "Creating " + templateNameAndfileSaveName.Value; object oMissing = Missing.Value; string currentDirectory = Directory.GetCurrentDirectory(); object oPathToTemplate = currentDirectory + "\\" + templateNameAndfileSaveName.Key; string absolutePathToSave = Path.GetFullPath(FullPathToClientDirectory); if (!File.Exists(oPathToTemplate.ToString())) { MessageBox.Show($"Cannot find template: {templateNameAndfileSaveName.Key}.\nPlease fill out remaining templates manually.", "Error", MessageBoxButtons.OKCancel); } Word._Application wordApplication = new Word.Application(); Word._Document currentDocument = wordApplication.Documents.Add(ref oPathToTemplate, ref oMissing, ref oMissing, ref oMissing); wordApplication.Visible = false; ReplaceBookmarksWithFormTextIn(currentDocument); currentDocument.Repaginate(); currentDocument.Fields.Update(); currentDocument.SaveAs2(Path.Combine(absolutePathToSave, templateNameAndfileSaveName.Value)); currentDocument.Close(); wordApplication.Quit(); }