PDA

View Full Version : Solved: Make all URLs in footnotes clickable?



technobunny
05-28-2011, 03:14 PM
Hi, I hope someone can help with this. (Won't let me post an examples of urls so I'm writing them out)

I have a Word document with a zillion footnotes, lots of them containing urls in the form <http colon slash slash whatever.com> - and I need to turn all the urls into clickable hyperlinks without having to go to each one, get rid of the <, hit the spacebar before the > and then restore the <.

I tried autoformat but it doesn't convert urls in footnotes (even when I select all the footnotes first), only urls in the main body of the document.

The spacebar thing works in footnotes when I do each url individually, but when I tried to record a macro and then do the spacebar thing in a footnote, it didn't turn it into a link. To go through and hit the spacebar manually for every one of those urls in the footnotes would take forever.

Is there a way to automatically convert all text in footnotes in the form <http colon slash slash whatever.com> into clickable links, please? Any suggestions would be gratefully received.

Or if it's impossible to do that, it would be helpful just to know.

Many thanks!

macropod
05-28-2011, 10:22 PM
Hi technobunny,

Here's how you can do it:
1. Convert all footnotes to endnotes
2. Use a wildcard Find/Replace in the endnotes where -
Find = \<(http[!\>]{1,})\>
Replace = {HYPERLINK \1}
3. Go to http://www.gmayor.com/export_field.htm#TextToField and download & install the macro there.
4. with the installed macro:
a) insert

'Set RngTmp = ActiveDocument.StoryRanges(wdEndnotesStory)'
between

'Set RngFld = Selection.Range'
and

'With RngFld'
b) change

Set RngTmp = ActiveDocument.Range(Start:=.Start + _
InStr(.Text, "{") - 1, _
End:=.Start + InStr(.Text, "}"))
to

RngTmp.Start = .Start + InStr(.Text, "{") - 1
RngTmp.End = .Start + InStr(.Text, "}")
5. Select the endnote range and run the macro
6. Convert the endnotes back to footnotes.

technobunny
05-29-2011, 04:55 AM
Hi Paul, thank you very much for your quick and helpful reply.

That worked very well to convert the urls into clickable links.

The only issue is that I need to retain the "<" and ">" symbols around the converted links, because the publisher requires them. Is there a way to do that please? Sorry I didn't make that clear earlier.

Thank you again for all your help, much appreciated.

technobunny
05-29-2011, 05:39 AM
Sorry, I am being slow here. I just realised that the solution was to change the "Find what" to this:
(http[!\>]{1,})

Thanks again Paul!