WallyZ
08-17-2015, 08:57 PM
I have the following VBA code to update a single link that is using a relative address but when the document is saved the address becomes absolute.
I have debugged the code and confirmed that "address" is a relative path.
Sub UpdateLink(address as string)
ChangeFileOpenDirectory ActiveDocument.Path
ActiveDocument.Hyperlinks.Add Anchor:=Selection.Range, address:=address, SubAddress:="", ScreenTip:="", TextToDisplay:="Link"
End Sub
I have checked Options->Advanced->Web Options->Update Links on Save = Ticked.
When I manually check (edit) each created hyperlink they appear to be relative (until the document is saved).
This instant the document is saved the hyperlinks become absolute.
Also once I have created one link programatically in the document any links manually created by the user also become absolute!
Any ideas what I'm doing wrong?
Walter
I have debugged the code and confirmed that "address" is a relative path.
Sub UpdateLink(address as string)
ChangeFileOpenDirectory ActiveDocument.Path
ActiveDocument.Hyperlinks.Add Anchor:=Selection.Range, address:=address, SubAddress:="", ScreenTip:="", TextToDisplay:="Link"
End Sub
I have checked Options->Advanced->Web Options->Update Links on Save = Ticked.
When I manually check (edit) each created hyperlink they appear to be relative (until the document is saved).
This instant the document is saved the hyperlinks become absolute.
Also once I have created one link programatically in the document any links manually created by the user also become absolute!
Any ideas what I'm doing wrong?
Walter