Word and hyperlink global replace problem
Discussion
I have a Word 2000 document with hyperlinks in a table. (about 500 links).
All the links have the IP address. However the server has now changed IP address and I should have been using the DNS name really.
I am having problems changing the hyperlinks automatically.
If I do a search and replace all then all that is changed is the text that is displayed in the table not the hyperlink behind the text.
If I right click the hyperlink and "toggle field codes" I see that the link has not changed.
In this state if I now search and replace it does replace the hyperlink. However I then have to do "update field" (right click on hyperlink) for the new hyperlink to be active.
Is there a way I can globally change all the hyperlinks? (from 123.123.123.123 to companyname)?
many thanks
All the links have the IP address. However the server has now changed IP address and I should have been using the DNS name really.
I am having problems changing the hyperlinks automatically.
If I do a search and replace all then all that is changed is the text that is displayed in the table not the hyperlink behind the text.
If I right click the hyperlink and "toggle field codes" I see that the link has not changed.
In this state if I now search and replace it does replace the hyperlink. However I then have to do "update field" (right click on hyperlink) for the new hyperlink to be active.
Is there a way I can globally change all the hyperlinks? (from 123.123.123.123 to companyname)?
many thanks
Not sure of the exact syntax, but I think you could do it as a macro using VBA. Pseudo-code something like:
for each oLink in activedocument.hyperlinks
oLink.address = replace(oLink.address,'ipaddress','hostname')
next
Someone will probably be along shortly with a better solution, but try a bit of light googling around VBA and hyperlinks.
edit to add better detail
>> Edited by jamieboy on Thursday 23 February 13:08
for each oLink in activedocument.hyperlinks
oLink.address = replace(oLink.address,'ipaddress','hostname')
next
Someone will probably be along shortly with a better solution, but try a bit of light googling around VBA and hyperlinks.
edit to add better detail
>> Edited by jamieboy on Thursday 23 February 13:08
Jnr said:
ooooh, this looks interesting.
Is it possible to do something like this in an excel file?
J
My excel doesnt support rft. (as rtf is rich text format) and using csv you cant. Excel saves the hyperlink and not the text for it, however when loading the csv back in, Excel does not see it as a hyperlink, just text.
Jnr said:If you mean the VBA stuff, then yes. Anything* you can do through the GUI in Excel, you can automate through VBA. There's loads of examples on MSDN - if you work with any sort of complicated MS Office documents at all, then it's well worth poking about and seeing what's possible.
ooooh, this looks interesting.
Is it possible to do something like this in an excel file?
J
*OK, I'm sure there are some things you can't do, but you get the idea.
Gassing Station | Computers, Gadgets & Stuff | Top of Page | What's New | My Stuff



