Change Hyperlink

M

mem

I have about, and I am not kidding, 100 procedure word documents that link to
each other. We were bought from another company and had to change the server
and location of all the documents. Is there an easy way to update all the
links without having to do each on indiviually? Thanks!
 
M

mem

Hi thanks for the response. The link is not working though.

macropod said:
Hi mem,

You might like to try my Field Link Updater:
http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Number=261488

--
Cheers
macropod
[MVP - Microsoft Word]


mem said:
I have about, and I am not kidding, 100 procedure word documents that link to
each other. We were bought from another company and had to change the server
and location of all the documents. Is there an easy way to update all the
links without having to do each on indiviually? Thanks!
 
M

macropod

Hi mem,

I've reported the broken link to the forum managers at Woody's. Hopefully they'll get it fixed soon.

--
Cheers
macropod
[MVP - Microsoft Word]


mem said:
Hi thanks for the response. The link is not working though.

macropod said:
Hi mem,

You might like to try my Field Link Updater:
http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Number=261488

--
Cheers
macropod
[MVP - Microsoft Word]


mem said:
I have about, and I am not kidding, 100 procedure word documents that link to
each other. We were bought from another company and had to change the server
and location of all the documents. Is there an easy way to update all the
links without having to do each on indiviually? Thanks!
 
M

macropod

Hi mem,

They've just finished re-roganising the forum software. The new link is:
http://www.wopr.com/index.php?showtopic=250058&st=20&p=261488&#entry261488

--
Cheers
macropod
[MVP - Microsoft Word]


mem said:
Hi thanks for the response. The link is not working though.

macropod said:
Hi mem,

You might like to try my Field Link Updater:
http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Number=261488

--
Cheers
macropod
[MVP - Microsoft Word]


mem said:
I have about, and I am not kidding, 100 procedure word documents that link to
each other. We were bought from another company and had to change the server
and location of all the documents. Is there an easy way to update all the
links without having to do each on indiviually? Thanks!
 
M

mem

Thanks so much. The link worked!

macropod said:
Hi mem,

They've just finished re-roganising the forum software. The new link is:
http://www.wopr.com/index.php?showtopic=250058&st=20&p=261488&#entry261488

--
Cheers
macropod
[MVP - Microsoft Word]


mem said:
Hi thanks for the response. The link is not working though.

macropod said:
Hi mem,

You might like to try my Field Link Updater:
http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Number=261488

--
Cheers
macropod
[MVP - Microsoft Word]


I have about, and I am not kidding, 100 procedure word documents that link to
each other. We were bought from another company and had to change the server
and location of all the documents. Is there an easy way to update all the
links without having to do each on indiviually? Thanks!
 
M

mem

Ok I looked at the document and are a little condused. Is there an example
of a macro they are talking about?
 
G

Graham Mayor

The following macro will change the path (or part of the path) defined in
oldPath to the path (or part of the path) defined in newPath in the
hyperlinks of all the documents in a folder selected from the dialog
prompted by the macro. The particular macro will only change one path at a
time. If you have more than one path to change it is doable, but needs extra
code to process each field.

Only the link is changed. The macro does not change the display text. Try it
on a folder with copies of a couple of sample documents.

Sub ChangeFieldContent()
Dim strFileName As String
Dim strPath As String
Dim oDoc As Document
Dim iFld As Long
Dim oldPath As String
Dim newPath As String
Dim fDialog As FileDialog
Set fDialog = Application.FileDialog(msoFileDialogFolderPicker)

oldPath = "D:\\My Documents" 'case sensitive
newPath = "D:\\My Documents\\Word Documents"

With fDialog
.Title = "Select Folder containing the documents to be modified and
click OK"
.AllowMultiSelect = False
.InitialView = msoFileDialogViewList
If .Show <> -1 Then
MsgBox "Cancelled By User"
Exit Sub
End If
strPath = fDialog.SelectedItems.Item(1)
If Right(strPath, 1) <> "\" Then strPath = strPath + "\"
End With

If Documents.Count > 0 Then
Documents.Close SaveChanges:=wdPromptToSaveChanges
End If

strFileName = Dir$(strPath & "*.doc")
While Len(strFileName) <> 0
Set oDoc = Documents.Open(strPath & strFileName)
For iFld = oDoc.Fields.Count To 1 Step -1
With oDoc.Fields(iFld)
If .Type = wdFieldHyperlink Then
If InStr(1, .Code, oldPath) <> 0 Then
.Code.Text = Replace(.Code.Text, _
oldPath, newPath)
End If
.Update
End If
End With
Next iFld
oDoc.Close SaveChanges:=wdSaveChanges
Set oDoc = Nothing
GetNextDoc:
strFileName = Dir$()
Wend
End Sub


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
M

macropod

Hi mem,

The macro is in a vba module included with the document.

It's a long while since I've tried to use and and, now that I'm using Vista, things may work a bit differently.

Regardless, you can get it to work by:
.. opening the FieldLinkUpdater file;
.. opening & selecting a document you want to process;
.. pressing Alt-F11 then clicking on 'Project(FieldLinkUpdater);
.. clicking on 'FiledTypeForm' and pressing F5.
Note: the document you want to process must be the active document before doing the last step.

An alternative approach would be to copy the two forms and the vba module in the FieldLinkUpdater file you Word's Normal.dot
template, from where it would be readily available at any time by selecting 'ResetLinkPath' from the macros list (Alt-F8).
 

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