Word XP Hyperlinks to Network docs - Need to capture the UNC
Posted on 2004-09-09
I am programmatically adding Hyperlinks in a Word XP document. The Hyperlinks point to other Word documents that are stored on various Network shares. I need to capture the full Network UNC paths for the hyperlink, as opposed to the mapped drive that the user is using to point to that document, so that when the document is distributed, all the other users can click on the hyperlink and open the document.
I have no problem inserting the hyperlinks programattically. I have code that opens the FileDialog box and allows the user to select the name of the file, and the filename and full path (of the mapped drive on the user's machine) is stored in a textbox on a UserForm. I then have the Hyperlinks created in the Word document from the textboxes on the UserForm. What I need to do is capture the UNC path somehow, and I can't seem to find any property or method that allows me to do that.
Here is the code that creates the hyperlink, which works fine:
ActiveDocument.Hyperlinks.Add Anchor:=Selection.Range, Address:= _
strText1, SubAddress:="", ScreenTip:="", TextToDisplay:= strText1
Thanks for your help!