Write text in Word Document at specific location using C#

109

Write text in Word Document at specific location using C# -

Application app = new Microsoft.Office.Interop.Word.Application();
Document doc = app.Documents.Open(@"your file");
string bookmark = "BookmarkName";

Bookmark bm = doc.Bookmarks[bookmark];
Range range = bm.Range;
range.Text = "Hello World";
doc.Bookmarks.Add(bookmark, range);

Comments

Submit
0 Comments