H
halletts
I have a large number of my own help documents that I keep on a zip
disk and whose links I access from a word document. Ater installing
Windows XP and s new CD burner the drive letter for the zip drive has,
of course, changed. Using VB6 to save the tedeum of manually changing
all the links from J: to L:. I wrote the following code as a module :
Public Sub test()
Dim i As Integer
Dim HlinkName As String
With ActiveDocument.Hyperlinks
For i = 1 To ActiveDocument.Hyperlinks.Count
HlinkName = ActiveDocument.Hyperlinks(i).Name
If Left$(HlinkName, 2) = "J:" Then
HlinkName = "L:" & Mid$(HlinkName, 3)
End If
Next i
End With
End Sub
When run nothing happens so I attempted to debug. Using step into and
viewing the locals window I can see that the call stack marker stops
at what seems the appropriate lines, the values in the locals windows
for I and HlinkName move though the links with no error messages
returned but when run as a macro or inserted as a document open event
still does not change the relevant link destinations.
Obviously I'm missing something pretty basic to have my code run
without errors and yet not produce any results.
Any suggestions?
Thanks,
Ed
disk and whose links I access from a word document. Ater installing
Windows XP and s new CD burner the drive letter for the zip drive has,
of course, changed. Using VB6 to save the tedeum of manually changing
all the links from J: to L:. I wrote the following code as a module :
Public Sub test()
Dim i As Integer
Dim HlinkName As String
With ActiveDocument.Hyperlinks
For i = 1 To ActiveDocument.Hyperlinks.Count
HlinkName = ActiveDocument.Hyperlinks(i).Name
If Left$(HlinkName, 2) = "J:" Then
HlinkName = "L:" & Mid$(HlinkName, 3)
End If
Next i
End With
End Sub
When run nothing happens so I attempted to debug. Using step into and
viewing the locals window I can see that the call stack marker stops
at what seems the appropriate lines, the values in the locals windows
for I and HlinkName move though the links with no error messages
returned but when run as a macro or inserted as a document open event
still does not change the relevant link destinations.
Obviously I'm missing something pretty basic to have my code run
without errors and yet not produce any results.
Any suggestions?
Thanks,
Ed