DNG - Cross reference link translation for RPE export
We can do cross reference links in DNG from a word in artifactA to a heading artifactB using edit artifactA->select word->add link->no traceability link to the heading artifactB in another part of the module.
Is this possible?
606
|
Accepted answer
You can use a post processing macro that processes external hyperlinks and turn them into internal hyperlinks to bookmarks (to heading artifacts). First, you can add bookmarks for Headings so that on clicking the cross reference link, you will be taken to the heading artifact.
Sub processHyperlinks()
'Processes external hyperlinks to RRC and turns them into internal Word hyperlinks to bookmarks with the 'address I<requirement artifact item id> Dim oHyperLink As Hyperlink For Each oHyperLink In ActiveDocument.Hyperlinks ' MsgBox ("Subaddress=" & ActiveDocument.Hyperlinks(counter).SubAddress & "Address=" & ActiveDocument.Hyperlinks(counter).address & "Name=" & ActiveDocument.Hyperlinks(counter).name & "TextToDisplay=" & ActiveDocument.Hyperlinks(counter).TextToDisplay) oHyperLink.Range.Select Dim address As String address = oHyperLink.address Dim index As Integer index = InStr(address, "/resources/") If index > 0 And address <> oHyperLink.TextToDisplay Then Dim name As String name = "I" + Right(address, Len(address) - index - 10) Dim display As String display = oHyperLink.TextToDisplay If display <> "" Then ActiveDocument.Hyperlinks.Add Anchor:=oHyperLink.Range, SubAddress:=name, TextToDisplay:=display End If Next oHyperLink End Sub Fariz Saracevic selected this answer as the correct answer
Comments
Sean F
commented Nov 14 '18, 6:57 a.m.
Thanks
Does this macro already exist?
I would have a go myself but I am not sure how a post-processing macro could translate a DNG URL into a an internal bookmark hyperlink.
Subramanya Prasad Pilar
commented Nov 14 '18, 8:02 a.m.
As I couldn't add it as comment, modified the answer.
Subramanya Prasad Pilar
commented Nov 21 '18, 2:18 a.m.
Were you able to get that working?
|
One other answer
Thank you Prasad for the detailed answer and the example macro
Sorry I did not follow up at the time you responded.
I look forward to trying out the suggested solution.
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.