View Single Post
 
Old 11-29-2018, 09:25 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,375
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

It's still not clear what you want. Perhaps:
Code:
Sub Demo()
With Selection
  .Paste
  With .Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = "https://doi.org/"
    .Replacement.Text = "doi:^c"
    .Forward = True
    .Wrap = wdFindContinue
    .Format = False
    .MatchCase = False
    .MatchWholeWord = False
    .MatchWildcards = False
    .MatchSoundsLike = False
    .MatchAllWordForms = False
    .Execute Replace:=wdReplaceOne
  End With
  If .Find.Found = True Then
    .Start = .Start + 4
    .Hyperlinks.Add Anchor:=.Range, Address:="https://" & .Text, TextToDisplay:=.Text
  End If
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote