Thanx for your support.
Finally i am using the bookmarkcollection method to get my output.
Only one issue is coming in output .
When i am reading first bookmark data in string , second bookmark name is also gets read in the fist string.
(I have attached the demo file from where i read the bookmarks data)
ExportedFile (1).zip (107.6 KB)
Can you please suggest where i am wrong in below code.
Document doc = new Document(fname);
BookmarkCollection bmCollection = doc.Range.Bookmarks;
foreach (Bookmark bm in bmCollection)
{
ArrayList nodes = ExtractContent1(bm.BookmarkStart, bm.BookmarkEnd);
StringBuilder sb = new StringBuilder();
for (int i = 0; i < nodes.Count; i++)
{
try
{
Node node = (Node)nodes[i];
if (node.IsComposite && ((CompositeNode)node).ChildNodes.Count > 0)
{
sb.Append(node.ToString(SaveFormat.Html));
}
}
catch (Exception ex)
{
string er = ex.Message;
}
}
string bookmarkName = bm.Name;
string bookmarkHtml = sb.ToString();
if (bookmarkName == "CFHeadings")
{
txtAddress1.Text = bookmarkHtml;
}
if (bookmarkName == "Insurance_FRR_Heading")
{
txtAddress2.Text = bookmarkHtml;
}
}