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 / November 2004

Tip: Looking for answers? Try searching our database.

Hyperlink

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rachelh - 17 Nov 2004 17:58 GMT
hello,
How can I move the cursor after a specific hyperlink using VBA?
I am finding the hyperlinks as follows:
For Each aHyperlink In ActiveDocument.Hyperlinks

Thanks

---
Message posted from http://www.ExcelForum.com/
Helmut Weber - 18 Nov 2004 08:47 GMT
Hi Rachel,
like this, e.g.:
Sub Test351()
Dim rDcm As Range
Dim oHpr As Hyperlink
Set rDcm = ActiveDocument.Range
For Each oHpr In rDcm.Hyperlinks
  If oHpr.Address = "another.doc" Then
     oHpr.Range.Select
     Selection.Collapse Direction:=wdCollapseEnd
     Exit For
  End If
Next
End Sub
---
Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word 2002, Windows 2000
Helmut Weber - 18 Nov 2004 14:11 GMT
<gr>
better this way:
ActiveDocument.Hyperlinks("chart.doc").Range.Select
plus collapse as in the former posting
---
Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word 2002, Windows 2000
 
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.