General discussion

Locked

Word Macro to Delete Hyperlinks

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.

This conversation is currently closed to new comments.

9 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by kesl In reply to Word Macro to Delete Hype ...

Point value changed by question poster.

Collapse -

by kesl In reply to Word Macro to Delete Hype ...

Point value changed by question poster.

Collapse -

by BFilmFan In reply to Word Macro to Delete Hype ...

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

Collapse -

by kesl In reply to

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.

Collapse -

by HAL 9000 Moderator In reply to Word Macro to Delete Hype ...

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 ALL HYPERLINKS from any document.

Col

Collapse -

by redddis In reply to

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.

Collapse -

Macro to remove hyperlinks in Word

by mjhf In reply to

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

Collapse -

by jerang@ In reply to Word Macro to Delete Hype ...

I can't stand macros, esp in Word 2007

Collapse -

Not sure about this

by viruser Staff In reply to Word Macro to Delete Hype ...
Back to Software Forum
9 total posts (Page 1 of 1)  

Related Discussions

Related Forums