View Single Post
 
Old 12-30-2020, 10:44 AM
alex100 alex100 is offline Windows 7 64bit Office 2016
Advanced Beginner
 
Join Date: May 2020
Posts: 79
alex100 is on a distinguished road
Default Remove the hyperlinks on paragraph marks

How can I remove the hyperlinks on paragraph marks, please?

What I have so far is this code...

Code:
Selection.Find.ClearFormatting
Selection.Find.Style = ActiveDocument.Styles("Hyperlink")
Selection.Find.Replacement.ClearFormatting
With Selection.Find
    .Text = "^p"
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindContinue
    .Format = True
    .MatchCase = False
    .MatchWholeWord = False
    .MatchWildcards = False
    .MatchSoundsLike = False
    .MatchAllWordForms = False
    .Execute Replace:=wdReplaceAll
 End With
The problem is that it will remove both the hyperlink and the paragraph. What I need is to preserve the paragraph and remove only the hyperlink.

Alex
Reply With Quote