File - Properties - Hyperlink Base

L

Lee

Can anyone tell me about the File - Properties - Hyperlink
Base which Word? I have some code that inserts a
hyperlink to a document on a particular drive (in my
network, it is M:\). When the user presses the button
which has the following code in it, and then saves the
document to another drive (e.g. P:\), the links break.

Code is:
Sub Hyperlink()

Dim fd As FileDialog, displaytext As String
'Create a FileDialog object as a File Picker dialog
box.
Set fd = Application.FileDialog
(msoFileDialogFilePicker)
'Use a With...End With block to reference the
FileDialog object.
With fd
'Set the initial path to the Agenda Attachments
folder.
.InitialFileName
= "file://M:\processes\documents\agenda attachments\"
.Title = "Select the File to which you want to
create the link"
'Use the Show method to display the File Picker
dialog box and return the user's action.
'If the user presses the action button...
If .Show = -1 Then
displaytext = .SelectedItems(1)
While InStr(displaytext, "\") > 0
displaytext = Mid(displaytext, InStr
(displaytext, "\") + 1)
Wend
displaytext = Left(displaytext, Len
(displaytext) - 4)
ActiveDocument.Hyperlinks.Add
Anchor:=Selection.Range, Address:=.SelectedItems(1),
TextToDisplay:=displaytext
' 'If the user presses Cancel...
Else
End If
End With

'Set the object variable to Nothing.
Set fd = Nothing

End Sub

I have tried to change the File - Properties - Hyperlink
Base within the Normal.dot to M:\ (or absolute terms is
\\alchemy\data\) but any new docs do not have the
Hyperlink Base settings as defined in the Normal.dot

Any ideas????
 

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