Results 1 to 6 of 6
  1. #1
    New Lounger
    Join Date
    Apr 2003
    Location
    Illinois, USA
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Removing Unwanted Hyperlinks (Word 2k)

    A couple of the cross-referencing and indexing functions include options (or defaults) to add a reference as a hyperlink. Is there a method, short of manually reentering the references, to delete the hyperlink (which is NOT compatible with PageMaker when exporting... and one of the documents is a law article with over 400 footnotes, about 1/3 of which include a cross-reference...)

    I have a similar question on tables of contents. I do NOT want my table of contents to make each entry a hyperlink--but I can't find help/documentation that tells me how to avoid this, and the method I used in Word97 doesn't work.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Removing Unwanted Hyperlinks (Word 2k)

    The field codes for the cross references etc. contain a switch h to specify hyperlinks. To remove them:

    Press Alt+F9 to display field codes.
    Press Ctrl+H to display the Replace dialog
    Enter h in the 'Find what' box, and clear the 'Replace with' box.
    Either replace the occurrences one by one, or click 'Replace All'.
    Press Alt+F9 to hide field codes.
    Press Ctrl+A, then F9 to update all fields.

  3. #3
    New Lounger
    Join Date
    Apr 2003
    Location
    Illinois, USA
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Removing Unwanted Hyperlinks (Word 2k)

    Well, that's certainly more than half the struggle! Thanks. That works for the cross-references... but does nothing for the TOC. Any suggestions there? I simply can't seem to build a TOC that doesn't have each line a hyperlink... and, although I can eventually live without it, I'd really rather not just eliminate it from the document.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Removing Unwanted Hyperlinks (Word 2k)

    Removing h from the field code for a TOC, then updating it removes the hyperlinks for me, but I'm using Word 2002. Perhaps someone with Word 2000 can comment.

  5. #5
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Removing Unwanted Hyperlinks (Word 2k)

    Are you doing this so you can import the text into PageMaker? If so then you probably don't need the TOC as a field. You can break the fields for it by:
    Select the TOC
    Press Ctrl-Shift-F9
    Press Ctrl-Space

    The second step removes the local hyperlink formatting that then appears despite the text not actually being a hyperlink after step 1.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  6. #6
    3 Star Lounger
    Join Date
    Mar 2003
    Location
    Elkins Park, Pennsylvania, USA
    Posts
    325
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Removing Unwanted Hyperlinks (Word 2k)

    For what it's worth, I was faced with a similar issue.

    I wrote the following piece of code and just assigned it to a menu option to remove the hyperlinks very quickly. One difference: I did not want to remove the hyperlinks from the TOC fields (including the List of Tables and List of Figures that are often included where I work.) That's why there is a double-"if" statement immediately after the beginning of the For/Each section. If you want ALL hyperlinks removed, you can delete that line and it's corresponding End If (immediately preceding the Next statement.)

    Sub RemoveHyperlinks()
    Dim hCode As String, cCode As String, fc As Integer
    Dim cField As Field

    For Each cField In ActiveDocument.Fields
    ' Check to see if the field is a TOC field or a PageRef field so that the hyperlinks are not removed from those types of fields.
    If cField.Type <> wdFieldTOC And cField.Type <> wdFieldPageRef Then
    hCode = cField.Code.Text
    If InStr(hCode, "h ") <> 0 Then hCode = " " & Trim(Replace(hCode, "h", "")) & " "
    cField.Code.Text = hCode
    End If
    Next

    StatusBar = "All hyperlinks, except for those in TOC's, have been removed from your document."

    End Sub
    <font face="Comic Sans MS">That's what you do in a herd; you look out for each other!</font face=comic> - Mike

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •