![]() |
#2
|
||||
|
||||
![]()
Try:
Code:
Sub ConvertURLTextsToHyperlinksInDoc() Application.ScreenUpdating = False Dim wdRng As Range For Each wdRng In ActiveDocument.StoryRanges With wdRng With .Find .ClearFormatting .Replacement.ClearFormatting .Text = "htt[ps]{1,2}://[!^13^t^l ^s]{1,}" .Replacement.Text = "" .Forward = True .Format = False .Wrap = wdFindStop .MatchWildcards = True .Execute End With Do While .Find.Found If .Characters.Last Like "[:;.,(?)!})]" Then .End = .End - 1 .Hyperlinks.Add .Duplicate, .Text, , , .Text .Start = .Hyperlinks(1).Range.End .Find.Execute Loop End With Next Application.ScreenUpdating = True End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Tags |
footnote, hyperlink |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Cobb78 | Word | 5 | 07-11-2016 06:23 AM |
![]() |
jsswadley | Word | 2 | 03-17-2015 04:44 PM |
![]() |
withers | Word | 1 | 08-21-2014 05:03 AM |
![]() |
Jamal NUMAN | Word | 2 | 07-03-2011 03:06 AM |
Microsoft word hyperlink to section in a pdf | Ian55555 | Word | 0 | 09-29-2009 09:30 PM |