I am trying to paste some text in a word file in c# and I tried this code from a stackoverflow post:
Microsoft.Office.Interop.Word.Application wordApp = null;
wordApp = new Microsoft.Office.Interop.Word.Application();
wordApp.Visible = true;
var filePath = @"H:\5555\Documents\Doc1.doc";
Document wordDoc = wordApp.Documents.Open(filePath);
Bookmark bkm = wordDoc.Bookmarks["name_field"];
Microsoft.Office.Interop.Word.Range rng = bkm.Range;
rng.Text = "Adams Laura"; //Get value from any where
So I get this error: Cannot implicitly convert "string" to "object" when I run this line.
"Document wordDoc = wordApp.Documents.Open(filePath);"
But I have no idea what kind of object I have to use.