Free Support Forum - aspose.com

Problem with adding Bookmark around Html table

Hi,

If I am trying to add bookmarks around a html table, the bookmark is not added.

For e.g. if I used the following code to add Bookmarks, it does not add the Bookmark

docBuilder.StartBookmark("ID");

docBuilder.InsertHtml("

"test"
");

docBuilder.EndBookmark("ID");

However, if I add any text before the "table" tag (e.g "abc

....
) then it adds the Bookmark correctly.

Thanks.

Hello

Thanks for your interest in Aspose.Words. I think in your case you can try using the code like the following:

Document doc = new Document();

DocumentBuilder docBuilder = new DocumentBuilder(doc);

docBuilder.StartBookmark("ID");

docBuilder.Writeln();

docBuilder.InsertHtml("

'test'
");

docBuilder.EndBookmark("ID");

doc.Save("C:\\Temp\\out.doc");

Best regards,