Copy link to clipboard
Copied
Am I missing something or it's another bug / poor design ?
When building a list / tree of Hyperlinks - HyperlinkExternalPageDestination, HyperlinkPageDestination, HyperlinkPageItemSource, HyperlinkTextDestination, HyperlinkTextSource, HyperlinkURLDestination - ALL of them have a Parent = Document - instead of a Hyperlink ? Why ??
Also, for some Hyperlinks, their Source or Destination returns error "Type Mismatch" when reading info (in VB) - even when in the DebugMode the Type is "TextStyleRange" AND is accessible when debugging AND ShowSource() / ShowDestination() works ??
Thought it's a damaged file and done IDMLing - but it didn't help.
And it's only for a few HyperlinkTextDestination, HyperlinkTextSource - in the file I have - but they look "normal" otherwise.
Can't share source INDD file but if someone have some idea for JS code for testing - would be great.
Copy link to clipboard
Copied
All those hyperlink objects are children of the document.
s = doc.hyperlinkTextSources.add();
d = doc.hyperlinkTextDestinations.add();
doc.hyperlinks.add (s, d);
That text source and text destination are used as parameters in the hyperlinks.add() function doesn't make them its children. They're all at the same level (or, to maintain the analogy, the same generation).
> Can't share source INDD file
Without the problem file there's not much we can say about the problem.
Copy link to clipboard
Copied
Now that you mention it - I can understand why Destination can't have a parent - as it can be a destination for multiple Hyperlinks.
But Source - can't be used in multiple Hyperlinks... Or can it??
I can build the tree from the Hyperlinks collection - but Source / Destination isn't always a HypetlinkSource / HyperlinkDestination - can be text directly, etc. - just thought it would be quicker / easier to do it from the childrens side - but as already determined - Destination can have many "starting points".
Copy link to clipboard
Copied
> But Source - can't be used in multiple Hyperlinks... Or can it??
Well, no, because that wouldn't make any sense. If you if you create a hyperlink on a single word, it can point to only a single destination.
I needed to be able to go forward and backward, to create a chain of links, so to speak. That was possible by setting a source on the first half of the word and another source, pointing to a different destination, on the second half.
Copy link to clipboard
Copied
Almost done and dusted.
This is a hierarchy by Parent -> Child - column TYPE:
And this is just sorted by ID:
which shows how many times each Destination is referenced - in this case HLDestination with ID=3949 (it's not visible here but each row have a hidden reference to the Parent for quick and easy access if necesssary).
Still need to add the rest of Hyperlink types.
Copy link to clipboard
Copied
All possible Hyperlinks and Bookmarks combined.
Top is displayed by hierarchy - bottom by ID so it's possible to see how many times particular destination is referred to.