View Single Post
 
Old 07-13-2018, 06:03 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,469
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

With the code I posted, change the With wdDoc … End With block to:
Code:
    With wdDoc
      .ActiveWindow.View.ShowFieldCodes = True
      With .Range
        With .Find
          .ClearFormatting
          .Replacement.ClearFormatting
          .Text = "()"
          .Replacement.Text = ""
          .Forward = True
          .Format = False
          .Wrap = wdFindContinue
          .MatchWildcards = False
          .Execute Replace:=wdReplaceAll
          .Text = "(^d HYPERLINK"
          .Wrap = wdFindStop
          .Execute
        End With
        Do While .Find.Found = True
          .MoveEndUntil ")", wdForward
          .End = .End + 1
          .Delete
          .Collapse wdcollpaseend
          .Find.Execute
        Loop
      End With
      .ActiveWindow.View.ShowFieldCodes = False
      .Close SaveChanges:=True
    End With
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote