I created a bookmarks in my docx using Word 2013.
One bookmark in header, one in footer and two in the body. Then i used the following code:
using (DocX document = DocX.Create(@"docs\BookmarkExample.docx"))
foreach (var paragraph in document.Paragraphs)
var v = paragraph.GetBookmarks();
var bookmark = paragraph.GetBookmarks().FirstOrDefault(x => x.Name == "HeaderBM");
if (bookmark != null)
When i run the code the output does not change bookmark values. In debug mode I am also noticing that paragraph collection is 0
Can someone please help!