Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2005

Tip: Looking for answers? Try searching our database.

Is selection a hyperlink?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
fubar01@cyberonic.com - 11 Feb 2005 01:53 GMT
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
Jay Freedman - 11 Feb 2005 03:13 GMT
>Hi:
>
[quoted text clipped - 5 lines]
>
>-- 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).

--
Regards,
Jay Freedman
Microsoft Word MVP         FAQ: http://word.mvps.org
fubar01@cyberonic.com - 11 Feb 2005 20:59 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.