Is selection a hyperlink?

F

fubar01

Hi:

In Word 2000 VBA, how do I determine if the selection is a hyperlink or
not? The selection.type property doesn't have this as one of its
types.

TIA

-- Roy Zider
 
J

Jay Freedman

Hi:

In Word 2000 VBA, how do I determine if the selection is a hyperlink or
not? The selection.type property doesn't have this as one of its
types.

TIA

-- Roy Zider

Hi Roy,

Check the value of Selection.Hyperlinks.Count. If it's 0, the
selection doesn't contain (and isn't contained in) a hyperlink. If
it's greater than 0, then the selection contains one or more
hyperlinks.

If the value is 1, you can look at Selection.Type to decide whether
the selection is extended (might contain regular text in addition to
the hyperlink) or collapsed (is inside the hyperlink).
 
F

fubar01

Jay:

Great idea -- thanks. It would have been too simple to allow this sort
of interrogation to be a property or return value of .type or
..information.

-- Roy
 

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