Recently I have been creating a series of “cheat sheets” on various topics related to blogging and social media using Microsoft Word 2007. These documents are essentially an annotated list of websites related to a particular topic, which I intend to provide to my clients as an aid to their own education and research.
Having long been a WordPerfect user, I was pretty happy with how these documents were looking and how easy it was to create the hyperlinks for them. But suddenly I realized that if I wanted to print one out and hand it to someone, they would have no way of knowing where the hyperlink was pointing to. The url for each link wasn’t visible.
Surely, I thought, I was not the first person to run into this problem. Surely there is an option on some menu that will enable me to display the urls when printing. But I searched the help file to no avail. I checked out three different books on the new version of Word out of the library. Nothing.
You might think it would be easier to copy and paste each url into the document in the appropriate place than to spend time researching a software based solution. But I had already created nine of these documents, and many had over two dozen links in them. That was too much copying-and-pasting for someone who has repetitive strain issues. It was worth it to me to keep hunting for a solution that would not bring on a bout of “tennis” elbow.
Public Function ConvertHyperlinks() Dim fld As Field For Each fld In ActiveDocument.Fields If fld.Type = wdFieldHyperlink Then fld.Select Selection.InsertAfter (" (" + Replace(Split(fld.Code.Text, " ")(1), Chr(34), "") + ")") End If Next End Function
No, I don’t know what it all means. I had a family member who is familiar with Visual Basic for Applications (VBA) look it over to make sure it wasn’t going to do something harmful before I tried it on one of my documents. To do that, I had to teach myself how to use the macro editor, but the library books helped with that.
This is just the latest example of the help I have gotten from total strangers who shared freely of their knowledge and time. I hope someone else faced with the same problem finds this helpful.