View Single Post
 
Old 08-17-2015, 08:07 PM
wdzambotti wdzambotti is offline Windows XP Office 2007
Novice
 
Join Date: Sep 2013
Posts: 4
wdzambotti is on a distinguished road
Default Hyperlinks defaulting to absolute instead of relative!!!

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.

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
Reply With Quote