We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to identify hidden bookmark using C#

In our application, where we have used ASPOSE word, the ‘bookmark’ having hyperlink is not getting identified as actual data.

Sample paragraph text which is returned from ASPOSE -
TOC \o “1-1” \h \z \u HYPERLINK \l “_Toc30507989” 1.1 RELATED DOCUMENTS PAGEREF _Toc30507989 \h 3

Expected Output -
1.1 RELATED DOCUMENTS

Also, please find attached document -
230900 Instrumentation and Control for HVAC-converted.pdf (697.2 KB)

Please suggest a solution for this issue to get the actual data.

@snehalkothawade

The table of content contains the hidden hyperlink fields. You can get the fields of document using Document.Range.Fields property. We suggest you, please Iterate over fields of document, get the hyperlink fields, and get their results using Field.Result property. This property returns the desired content along with PageRef field information. You can extract the desired content from the result of Field.Result.

Hi Tahir,

Thanks for your reply, can you please tell me how can I get Paragraph content excluding TOC and Hyperlinks. Also if possible please send me sample code snippet.

Thanks,
Snehal

@snehalkothawade

Please ZIP and attach your input Word document here for our reference. We will then provide you code example according to your requirement.