Question

I have a .docx file with a bunch of bookmarks and hyperlinks. I can navigate through these in documentviewer just fine. What I would like is if it was possible to generate a list of all of the hyperlinks contained in the file. From there, I can create a TreeView on the documentviewer and call the links by name (using the list) instead of static page numbers.

Is this possible? If so, how?

Or is there a [free] utility that could generate an XML file with all of the hyperlinks and their referenced page numbers or Uris?

Was it helpful?

Solution

I figured this out shortly after posting the question, but thought I should post it here because I received a message elsewhere about this.

XPS documents are essentially zip files. Open and extract it. Find your way to docstructure and you'll see an XML file which is easy to parse. From there, you can get all the information you want about the hyperlinks from the table of contents. Then you just set the request URI handlers in C# in WPF.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top