Topic Title Hyperlinks in HTML Help not converting to Printed Documentation
Date Posted:
09/09/2005 07:29:00 PM
Posted By: vhendr (Junior Member)
I am attempting to use Robohelp for single sourcing, but when I generate printed documentation all hyperlinks are lost. Should they remain intact?
Date Posted:
09/10/2005 11:44:40 AM
Posted By: Peter Grainge (Senior Member)
Thatīs the way it was designed unfortunately. Look on my site under Printed Documentation.
Visit www.grainge.org for a range of RoboHelp and authoring related topics.
Date Posted:
11/22/2005 04:03:17 PM
Posted By: TannisT (Junior Member)
I have also had the problem where I lost all my hyperlinks when generating to word or PDF from RoboHelp. As a work around a collegue and I created a Word macro. It is of course not perfect but generally does the trick. After you generate the Word document from RH, the macro searches for the HYPERLINK style - which comes across when RH generates the Word doc, and tries to match the text in the style with a heading style. Once a match is found, the macro creates a cross reference and adds the page number. The caveat is that you must make sure that in RH your hyperlinks are an exact match to the heading.
I found that you can use online and print conditional text to switch between hyperlinks in online text and the exact heading text for traditional cross reference text in printed or PDF documentation.
For those who are also having problems with this, I hope this macro helps:
Sub theOne()
Dim myHeadings() As String
'Dim myPageNumbers() As String
Dim i As Integer
'store all heading information
myHeadings = ActiveDocument.GetCrossReferenceItems(wdRefTypeHeading)
'move the cursor to section 3
Selection.HomeKey Unit:=wdStory
Selection.Move wdSection, 2
'search for text with hyperlink style
Selection.Find.ClearFormatting
Selection.Find.Style = ActiveDocument.Styles("Hyperlink")
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Execute FindText:="", Format:=True
While .Found = True
'loop around refs to find the right one and update link
For i = 1 To UBound(myHeadings)
If Selection = Trim(myHeadings(i)) Then
'update the style with a real link and page info
Selection.Delete
Selection.InsertCrossReference ReferenceType:="Heading", ReferenceKind:= _
wdContentText, ReferenceItem:=CStr(i), InsertAsHyperlink:=True, _
IncludePosition:=False, SeparateNumbers:=False, SeparatorString:=" "
Selection.TypeText Text:=" on page "
Selection.InsertCrossReference ReferenceType:="Heading", ReferenceKind:= _
wdPageNumber, ReferenceItem:=CStr(i), InsertAsHyperlink:=True, _
IncludePosition:=False, SeparateNumbers:=False, SeparatorString:=" "
End If
Next i
.Execute
Wend
End With
End Sub
Date Posted:
06/06/2006 10:34:03 PM
Posted By: Moosegolfr (Junior Member)
Awesome Macro. I was able to use it for my Word doc to make changes, but for some reason it hangs on the last bit of the Macro. Any ideas?
Date Posted:
06/06/2006 10:53:33 PM
Posted By: Peter Grainge (Senior Member)
Yup. The fix is here. Click here.
Visit www.grainge.org for a range of RoboHelp and authoring related topics.
Close Window