Email this Page
Log Support Call
Send Feedback
Print
|
|||||
Creating Clickable URL Links When Publishing to WordA couple of people have asked recently how to avoid the repetition of URLs in their published Word output - for example they report they get something like: This is the correct behaviour - because the anchor text (the text with the link applied to it) is a URL. A cross reference is made up of two parts - the anchor text (which appears as regular text with the hotspot style applied) and the actual cross reference (such as the page number or the URL). This means that when you apply a cross reference to a URL you will get the URL twice. To avoid the repetition you need to either:
If choosing the second option, you can then use an AfterPublish macro to turn the URL into a clickable hyperlink in the Word document. The macro would need to turn the autoformat feature on (found in Word under Format > Autoformat > Options) then remove all the checkboxes apart from the Internet and network paths with hyperlinks.
Note: This is the same method you would need to use in MS Word if you copied and pasted text containing a URL. A clickable link is not created until you have entered a space after the URL (provided you have the autoformat option enabled) or formatted the document as described above. The following macro should do the trick, or at least be a good start: Sub AfterPublish ' Turn the autoformat option on to replace internet ' and network paths with hyperlinks With Options .AutoFormatApplyHeadings = False .AutoFormatApplyLists = False .AutoFormatApplyBulletedLists = False .AutoFormatApplyOtherParas = False .AutoFormatReplaceQuotes = False .AutoFormatReplaceSymbols = False .AutoFormatReplaceOrdinals = False .AutoFormatReplaceFractions = False .AutoFormatReplacePlainTextEmphasis = False .AutoFormatReplaceHyperlinks = True .AutoFormatPreserveStyles = False .AutoFormatPlainTextWordMail = False End With Selection.Document.Kind = wdDocumentNotSpecified Selection.Range.AutoFormat End Sub Remember also that we've designed the Word output with the intention of it being a printed document, and not with the intention of it being viewed online. |
|||||
| Top of Page |
Email this Page
Log Support Call
Send Feedback
Print
|
||||
|
|||||