Hi, I'm killing myself trying to get VBA to hyperlink specific text within a TextFrame without hyperlinking the entire TextFrame! I'm using regular expressions to recognize specific patterns and provide a hyperlink based based on a generic URL. The code below, no matter how I try to revise it, links ALL the text within the range (shape).
Any help vastly appreciated!
THANKS!
-Tim
Here's the code:
For Each sld In Application.ActivePresentation.Slides
For Each shp In sld.Shapes
If shp.HasTextFrame Then
Set txtRng = shp.TextFrame.TextRange
For Each m In re.Execute(txtRng)
fullURL = URL1 + m.Value + URL2
stop = m.Length
With shp.TextFrame.TextRange.Characters(m.FirstIndex, stop)
With .ActionSettings(ppMouseClick)
.Action = ppActionHyperlink
.Hyperlink.Address = fullURL
End With
End With
Next
End If
Next
Next