Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2004-09-09
4
Medium Priority
?
303 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

610 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