I'm stumped on this one - I think it can be scripted but I don't know for sure.
I can't find a way to do it with the conventional tools in InDesign.
@Eugene – of course you cannot apply a hyperlink to a Paragraph Style, but one can apply a hyperlink to a text range (e.g. a whole paragraph).
In InDesign CS5.5, just select the text range, go to the Hyperlinks Panel, chose "New Hyperlink…" and set your properties like: URL etc.
Now the hyperlink is set for that text range you could duplicate that text range along with the hyperlink by copy/paste and change the contents afterwards.
For changing the contents of the duplicate, do NOT select ALL the text, but only a portion and edit the text. THEN remove the remnants of the old text. The area of the hyperlink will adapt.
To automate something like this, e.g. put a hyperlink to all text ranges that are formatted with a specific character style or paragraph style requires scripting.
But I'm not sure what Sven *exactly* would like to achieve…
From what I understand is that they have a Paragraph style for
<paragraph style 1>This is a part no. 1457EC for the item
And they want to find the Part No. in the Paragraph style and add in the Hyperlink for all the part no's within a paragraph style.
Finding the Part No. would be easy - but giving it a Hyperlink - there's the problem.
It would be ok if all the Part no.s were 1457EC because you could just find and replace them with the GREP ~C or ~c (can't remember which one is the right one).
But if the part no.s are changing then using the ~C in the GREP is useless - (actually haven't tried the ~C yet but I imagine it would take the hyperlink on the for the ride?)
You are correct. That's exactly what i'm trying to do. And indeed not all of the article nrs are the same. On the contrary. They are all unique.
Is there a way i can send you guys the file to try it out?