How can a macro recognize a string of text as a hyperlink?

  • Thread starter david.f.jenkins
  • Start date
D

david.f.jenkins

How can I recognize a string of text (which may be embedded within a
longer string) as being a hyperlink?

Assuming I can do that, I think I have doped out a way to remove the
link, but if anyone knows an easy way to do that, I'd be beholden.

Thanks!
 
P

Perry

Use InStr() or InStrRev() functions

Look here for documentation
(note: 1 URL - runs from http: thru to .asp)
http://msdn.microsoft.com/library/d...ry/en-us/odeopg/html/deconsearchingstring.asp

For utilization see below ( immediate window) examples
? InStr("This is my long string", "is my")
6
? InStr("This is my long string", "something else")
0
-------------------------------------
Krgrds,
Perry

System parameters:
POS: WinXP x64
MSO: MSOffice System
DEV: VS7 (dotnet)
 
D

david.f.jenkins

Thanks, Perry.

I have used regular expressions to find the hyperlink text, and created
a temporary text range for that text. I then applied this code to the
temporary textrange:

with tempRange
.ActionSettings(ppMouseClick).action = ppActionNone
.ActionSettings(ppMouseOver).action = ppActionNone
end with

Works like a champ!

Thanks again for your help...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top