![]() |
|
#1
|
|||
|
|||
|
The macro here below works perfectly when the string is followed by a space. How do I modify the code so as to make it work also when the string is followed by , ; . : etc.? Can someone help? Code:
Dim Rng As Range
Dim SearchString As String
Dim Link As String
Set Rng = ActiveDocument.Range
SearchString = "http"
With Rng.Find
.MatchWildcards = True
Do While .Execute(findText:=SearchString, Forward:=False) = True
Rng.MoveStartUntil ("http")
Rng.MoveEndUntil Cset:=" "
Link = Rng.Text
ActiveDocument.Hyperlinks.Add Anchor:=Rng, _
Address:=Link, _
SubAddress:="", ScreenTip:="", TextToDisplay:=Rng.Text
Rng.Font.Color = 15597568 'codice di Word
Rng.Collapse wdCollapseStart
Loop
End With
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| http/1.0 404 not found | Powerpoint User | PowerPoint | 2 | 11-20-2016 11:10 PM |
| Find whether string contains hyperlink and Process the same | PRA007 | Word VBA | 15 | 12-01-2015 02:57 AM |
| Multiple Hyperlink to a single string | PRA007 | Word VBA | 7 | 11-09-2015 04:29 PM |
| Outlook http server | joelwelford | Outlook | 0 | 09-07-2015 10:00 AM |
Way to search for a string in text file, pull out everything until another string?
|
omahadivision | Excel Programming | 12 | 11-23-2013 12:10 PM |