General discussion

  • Creator
    Topic
  • #2191629

    Word Macro to Delete Hyperlinks

    Locked

    by kesl ·

    I have several Word macros that can and do delete all hyperlinks in any Word document. None provide what I am looking for. I need a Word macro that will delete all external hyperlinks leaving the text in place (but not preserving any underlines or coloring)… I also need to leave in place any hyperlinks that are internal (bookmark) hyperlinks. I want the macro to run without human intervention. No ‘yes’ or ‘no’ questions.

All Comments

  • Author
    Replies
    • #3266810

      Reply To: Word Macro to Delete Hyperlinks

      by kesl ·

      In reply to Word Macro to Delete Hyperlinks

      Point value changed by question poster.

    • #3266809

      Reply To: Word Macro to Delete Hyperlinks

      by kesl ·

      In reply to Word Macro to Delete Hyperlinks

      Point value changed by question poster.

    • #3266733

      Reply To: Word Macro to Delete Hyperlinks

      by bfilmfan ·

      In reply to Word Macro to Delete Hyperlinks

      There was an article with a large thread on this issue here at TR at http://techrepublic.com.com/5100-1035_11-1051631.html

      • #3267754

        Reply To: Word Macro to Delete Hyperlinks

        by kesl ·

        In reply to Reply To: Word Macro to Delete Hyperlinks

        Poster rated this answer.

        I have already read that complete thread. The references there and the example macros strip ALL hyperlinks. I want to strip select (external) hyperlinks leaving text.

    • #3266626
      Avatar photo

      Reply To: Word Macro to Delete Hyperlinks

      by hal 9000 ·

      In reply to Word Macro to Delete Hyperlinks

      Then your only solution is to write a Macro that allows you to select what Hyperlinks to remove.

      Most of the existing pieces of code are specifically written to remove [b]ALL HYPERLINKS[/b] from any document.

      Col

      • #2916053

        Reply To: Word Macro to Delete Hyperlinks

        by redddis ·

        In reply to Reply To: Word Macro to Delete Hyperlinks

        Probably you could easily alter one of those scripts. The only thing
        you need to do is to add an extra if, which checks whether the
        hyperlink is external (starts from http://). voila.

      • #2945853

        Macro to remove hyperlinks in Word

        by mjhf ·

        In reply to Reply To: Word Macro to Delete Hyperlinks

        Here is a macro that Abigail Parker wrote for me to remove hyperlinks in the footnotes or endnotes of a Word document. See if this helps others.

        Sub RemoveHyperLinksEndnotes()

        ‘ RemoveHyperLinksEndnotes Macro
        ‘ Macro recorded 5/20/2009 by Abigail Parker

        Selection.Find.ClearFormatting
        Selection.Find.Replacement.ClearFormatting
        With Selection.Find
        .Text = “^e”
        .Replacement.Text = “”
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
        End With
        Selection.Find.Execute
        If Selection.Find.Found Then
        If ActiveWindow.ActivePane.View.Type = wdPageView Or ActiveWindow. _
        ActivePane.View.Type = wdOnlineView Or ActiveWindow.ActivePane.View.Type _
        = wdPrintPreview Then
        ActiveWindow.View.SeekView = wdSeekEndnotes
        Else
        ActiveWindow.View.SplitSpecial = wdPaneEndnotes
        End If
        Selection.WholeStory
        Dim i As Integer
        For i = Selection.Hyperlinks.Count To 1 Step -1
        Selection.Hyperlinks(i).Delete
        Next i
        ‘ ActiveWindow.ActivePane.Close
        End If
        End Sub

        Sub RemoveHyperLinksFootnotes()

        ‘ RemoveHyperLinksFootnotes Macro
        ‘ Macro recorded 5/20/2009 by Abigail Parker

        Selection.Find.ClearFormatting
        Selection.Find.Replacement.ClearFormatting
        With Selection.Find
        .Text = “^f”
        .Replacement.Text = “”
        .Forward = True
        .Wrap = wdFindContinue
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
        End With
        Selection.Find.Execute
        If Selection.Find.Found Then
        If ActiveWindow.ActivePane.View.Type = wdPageView Or ActiveWindow. _
        ActivePane.View.Type = wdOnlineView Or ActiveWindow.ActivePane.View.Type _
        = wdPrintPreview Then
        ActiveWindow.View.SeekView = wdSeekFootnotes
        Else
        ActiveWindow.View.SplitSpecial = wdPaneFootnotes
        End If
        Selection.WholeStory
        Dim i As Integer
        For i = Selection.Hyperlinks.Count To 1 Step -1
        Selection.Hyperlinks(i).Delete
        Next i
        ‘ ActiveWindow.ActivePane.Close
        End If
        End Sub

    • #2792001

      Reply To: Word Macro to Delete Hyperlinks

      by jerang- ·

      In reply to Word Macro to Delete Hyperlinks

      I can’t stand macros, esp in Word 2007

    • #2802336

      Not sure about this

      by viruser ·

      In reply to Word Macro to Delete Hyperlinks

Viewing 5 reply threads