Hi Allan,
Thanks for your inquiry. I believe, the following code change will fix this issue:
Document doc = new Document(MyDir + @"Global+warming.docx");
BookmarkCollection bmCollection = doc.Range.Bookmarks;
DataTable dtUnitCurriculum = new DataTable();
foreach(Bookmark bm in bmCollection)
{
ArrayList nodes = ExtractContent1(bm.BookmarkStart, bm.BookmarkEnd);
StringBuilder sb = new StringBuilder();
for (int i = 0; i <nodes.Count; i++)
{
Node node = (Node) nodes[i];
if (node.IsComposite)
{
sb.Append(node.ToString(SaveFormat.Html));
if (((CompositeNode) node).LastChild.NodeType == NodeType.BookmarkEnd)
i = nodes.IndexOf(((CompositeNode) node).LastChild.PreviousPreOrder(doc)) + 1;
else
i = nodes.IndexOf(((CompositeNode) node).LastChild) + 1;
continue;
}
sb.Append(node.ToString(SaveFormat.Html));
}
string bookmarkName = bm.Name;
string bookmarkHtml = sb.ToString();
}
Best regards,