![]() |
|
#5
|
||||
|
||||
|
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] |
| Tags |
| copy and paste, macro, recorder |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Macro for copying text between two Words.
|
Demonic | Word VBA | 3 | 07-18-2017 09:08 PM |
Copying Certain Text From Numerous Cells using Macro
|
Sean_Needs_Help | Excel | 3 | 11-08-2016 04:39 PM |
| Macro recorder changing reference style for columns in pivot source | andylaw31 | Excel Programming | 0 | 06-15-2016 08:45 AM |
Macro recorder and ShowFieldCodes
|
Jennifer Murphy | Word VBA | 1 | 11-04-2012 01:55 AM |
Picture properties bug in Word 2010 Macro Recorder
|
ralphpickering | Word VBA | 5 | 10-24-2012 10:15 AM |