some automated way to update the hyperlinks

R

Ron Whitehead

Is there some automated way to update the hyperlinks in
all documents on our server there are 1200 of them.

We tried to follow a link that I had changed in the a
document and it wouldn't work until he actually went in
the link, edited it, followed the file, and clicked ok. Of
course, many of these are just references and not actual
links but to do a manual update or at least figure out
which files to prioritize seems a little overwhelming.

Some one mentioned they thought there was a way to make
these links dynamic.
 
L

lostinspace

----- Original Message -----
From: Ron Whitehead <>
Newsgroups: microsoft.public.word.docmanagement
Sent: Tuesday, July 15, 2003 10:18 AM
Subject: some automated way to update the hyperlinks

Is there some automated way to update the hyperlinks in
all documents on our server there are 1200 of them.

We tried to follow a link that I had changed in the a
document and it wouldn't work until he actually went in
the link, edited it, followed the file, and clicked ok. Of
course, many of these are just references and not actual
links but to do a manual update or at least figure out
which files to prioritize seems a little overwhelming.

Some one mentioned they thought there was a way to make
these links dynamic.

Your server should allow use of htaccess and the REDIRECT option.
This does not involve editing of the links within the pages themselves,
rather a reaction telling the server how to handle those old non-existent
links.
 
D

Doug Robbins - Word MVP

Hi Ron,

If the other suggestion doesn't work, you can probably modify the following
macro and use it with a variation of the batch process macro in the article
"How to Find & ReplaceAll on a Batch of Documents in the Same Folder" at:

http://www.mvps.org/word/FAQs/MacrosVBA/BatchFR.htm

to do what you want:

' Macro created 26/10/01 by Doug Robbins to update links in a document
'
Dim alink As Field, linktype As Range, linkfile As Range
Dim linklocation As Range, i As Integer, j As Integer, linkcode As Range
Dim Message, Title, Default, Newfile
Dim counter As Integer


counter = 0
For Each alink In ActiveDocument.Fields
If alink.Type = wdFieldLink Then

Set linkcode = alink.Code
i = InStr(linkcode, Chr(34))
Set linktype = alink.Code
linktype.End = linktype.Start + i
j = InStr(Mid(linkcode, i + 1), Chr(34))
Set linklocation = alink.Code
linklocation.Start = linklocation.Start + i + j - 1
If counter = 0 Then
Set linkfile = alink.Code
linkfile.End = linkfile.Start + i + j - 1
linkfile.Start = linkfile.Start + i
Message = "Enter the modified path and filename following this
Format " & linkfile
Title = "Update Link"
Default = linkfile
Newfile = InputBox(Message, Title, Default)
End If
linkcode.Text = linktype & Newfile & linklocation
counter = counter + 1
End If
Next alink

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
M

macropod

Hi Ron,

I take it that you've changed the folder structure, and so
the hyperlinks no longer work. If that is so, you'll have
to update the paths in the links to get them to work
again. Word doesn't have an in-built way of doing this,
but there's a ulitily I delveloped to do this that you can
download from:
http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?
Number=261488

Cheers

PS: Remove NO.SPAM from the above before replying.
 

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