This project has moved and is read-only. For the latest updates, please go here.

Duplicate bookmarks in Docx

Mar 15, 2017 at 1:54 PM
I am using Novacode docx to read bookmarks and replace them with my data. Looking at my docx file, I have a bookmark called 'UserID' and I try and replace it in my c# code as below

using (DocX doc = DocX.Load(oTemplate))

The error I get is "sequence contains more than one element" When I look in the debugger the object of doc, there are actually two bookmarks with the name 'UserID' but in word there is only one. I am using word 2016. Anybody has any ideas what the problem could be?