hyperlink properties and or methods

D

Dave Patrick

Office 2003
I have a couple of word documents that contain a few hundred hyperlinks. I
have need to edit these links and have worked out a procedure to loop
through them in the manner needed. The two properties I need to edit are the
'text to display' and the 'address' I can't seem to find the correct VBA
method and or property to do so. Anyone can help?

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft MVP [Windows NT/2000 Operating Systems]
http://www.microsoft.com/protect.
 
J

Jezebel

Dim pHyperlink as Hyperlink

For each pHyperlink in ActiveDocument.Hyperlinks

With pHyperlink
.TextToDisplay = "Click here for XYZ"
.Address = "www.mysite.com"
End with

Next
 
D

Dave Patrick

Hey that works perfectly. (but you probably already knew that) That's
exactly what I needed. Thank you very much.

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft MVP [Windows NT/2000 Operating Systems]
http://www.microsoft.com/protect.

:
| Dim pHyperlink as Hyperlink
|
| For each pHyperlink in ActiveDocument.Hyperlinks
|
| With pHyperlink
| .TextToDisplay = "Click here for XYZ"
| .Address = "www.mysite.com"
| End with
|
| Next
 
T

Thomas Winter

Dave Patrick said:
Office 2003
I have a couple of word documents that contain a few hundred hyperlinks. I
have need to edit these links and have worked out a procedure to loop
through them in the manner needed. The two properties I need to edit are the
'text to display' and the 'address' I can't seem to find the correct VBA
method and or property to do so. Anyone can help?

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft MVP [Windows NT/2000 Operating Systems]
http://www.microsoft.com/protect.

Take a look at the Hyperlinks collection of the Document object.

-Tom
 

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