Manu,
I’m still learning this stuff too (I’m more interested in merge fields and content controls at present), so it’s a bit of the blind leading the blind, but see if this helps:
Have a look at Wordprocessing Hyperlinks in officeopenxml.com, which explains the difference between external and internal links.
I assume you have already looked at How to Replace or Modify Hyperlinks and Replace Fields with Static Text on the Aspose.Words documentation site, together with the example source at https://github.com/aspose-words/Aspose.Words-for-.NET/tree/master/Examples on GitHub?
I note, however, that you were asking about the hyperlinks in a TOC. As I understand it, they are hyperlink fields in a TOC, but they link to PAGEREF fields. And in all the examples I’ve looked and and created, they do have “begin”, “separate” and “end” tags.
See Eric’s Screen-Cast: Exploring Tables-of-Contents in Open XML WordprocessingML Documents, the first of five screencasts on TOCs.
It might help if you explained exactly what you are trying to do with the TOC. I assume you are using Aspose.Words?
Hope this is of assistance.
Cheers.
John
Manu,
Not sure if this is what you are looking for:
Retrieving Fields in Open XML WordprocessingML Documents
It explains a console app called QueryFields that writes out the field code and value of every field in the (hard-coded) specified document. The source is linked from the blog post.
Hope this helps.
John