Solved

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

Posted on 2004-09-09
4
296 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 500 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
python question 5 76
python sqlite question 11 46
Not needed 13 112
Turning python script into an applet 12 110
A short article about a problem I had getting the GPS LocationListener working.
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

776 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