|
|
Question : Hyperlink Display in MS Word
|
|
Usually when I insert a Hyperlink in an MS Word document it displays as the following: {HYPERLINK "ADDRESS.RTF"} but on one of my machines it is displaying using the unc name: {HYPERLINK "\\mmcserver...\ADDRESS.RTF"}. The machine has Word 2000 on it and I've played around with the Autocorrect settings and can't seem to fine a solution to it.
|
Answer : Hyperlink Display in MS Word
|
|
OK. Here we go: In the document, go F11 to get to the code window. In the Project window, double click on "This Document" for your file. In the main panel, paste in the following code:
Private Sub Document_Close() 'This code runs after the document is closed, and strips out everything before the final backslash. Dim hypCurrent As Hyperlink For Each hypCurrent In ActiveDocument.Hyperlinks strText = Right(hypCurrent.Address, Len(hypCurrent.Address) - InStrRev(hypCurrent.Address, "/")) hypCurrent.Address = strText hypCurrent.ScreenTip = strText Next ActiveDocument.Save End Sub
|
|
|
|
|