?
Solved

Word XP Hyperlinks to Network docs - Need to capture the UNC

Posted on 2004-09-09
4
Medium Priority
?
306 Views
Last Modified: 2010-04-17
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!
       
0
Comment
Question by:SWisowaty
  • 3
4 Comments
 
LVL 22

Accepted Solution

by:
cookre earned 2000 total points
ID: 12017884
0
 
LVL 22

Expert Comment

by:cookre
ID: 12017915
In .NET, just use WNetGetUniversalName()
0
 
LVL 22

Expert Comment

by:cookre
ID: 12017930
0
 

Author Comment

by:SWisowaty
ID: 12042873
Thanks, cookre - just what I needed!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
Starting up a Project
Screencast - Getting to Know the Pipeline

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question