<< Click here to Goto HomePage

     
     

Wednesday, September 05, 2007

How to Unlink Every Hyperlink in a Microsoft Word Document ?

Unlinking a single hyperlink is as easy as select it, then right-clicking and choosing Remove Hyperlink from the shortcut menu. But what about unlinking all hyperlinks? Word offers no built-in way to unlink every hyperlink in a document all at once. However, you can use a macro to get the job done. Running the following macro achieves the same result as selecting each hyperlink and choosing Remove Hyperlink from the shortcut menu.

I had to come up with this for a document that had something like 100+ Hyperlinks.


  • In Word, click to Tools > Macro > Visual Basic Editor (or press F11)
  • Right-click the Normal icon to make changes to the global Normal.dot template, then select Insert > Module
  • Paste the code below into the text box. Click File > Save Normal. Alternately, you can save this macro in a template of your choice



Sub RemoveAllHyperlinks( )
Dim i As Integer
For i = ActiveDocument.Hyperlinks.Count To 1 Step -1
ActiveDocument.Hyperlinks(i).Delete
Next i
End Sub

Run this macro in Word from the Tools > Macro > Macros dialog.

This just works wonders when in need.

6 comments:

  1. Unknown said,

    Another option for removing hyperlinks is to use keyboard shortcuts.

    1. Click anywhere within the hyperlinked text you want to "unlink" or press [Ctrl] [A] to select the entire document ([command] A in Word 2004).

    2. Press [Ctrl] [Shift] [F9] or [Ctrl] 6 ([command] [shift] [F9] or [command] 6 in Word 2004).

    Word removes the hyperlinks without disturbing the text. If you used display text to represent a hyperlink -- for instance, "Click Here" instead of the URL -- only "Click Here" remains.

    Caution: This technique also removes any existing field codes, so use it with care.

    on 9/10/2007 12:27 AM


  2. Jason S said,

    Hi Michael,

    Thanks for giving the other option in doing this.

    Cheers!!
    Jason

    on 9/11/2007 1:02 PM


  3. Unknown said,

    lol thx for the mini tutorial jason

    on 10/22/2009 1:08 AM


  4. Alexis said,

    Some days ago my friend had the problem.And he told me how he solved it.All his doc files were corrupted and he didn't know what to do.But he accidentally found in google next program-repair a docx file.It solved the problem in 30 seconds,moreover he knew how utility recover corrupted files in .doc, .docx, .dot and dotx format, as well as *.rtf (Rich Text format).

    on 12/05/2009 10:01 AM


  5. Anonymous said,

    You have no idea how helpful that was! Thanks.

    on 2/11/2010 1:51 AM


  6. Anonymous said,

    Thanks Michael, CTRL SHIFT F9...just saved me about an hours work..

    on 4/26/2010 2:08 PM