Thread: server name
View Single Post
  #5   Report Post  
Posted to microsoft.public.word.docmanagement
Patricia Shannon Patricia Shannon is offline
external usenet poster
 
Posts: 23
Default server name

I found it. The ShareName property gives both the server name and share name:
\\ServerName\ShareName
which is exactly what I wanted.
eg.

Dim Fso
Dim Drv

Set Fso = CreateObject("Scripting.FileSystemObject")
Drv = Fso.GetDriveName("I:\CIS")
Debug.Print "Drv="; Drv '
Debug.Print "Path="; ActiveDocument.Path
Set Drv = Fso.getdrive(Fso.GetDriveName(ActiveDocument.Path) )
Debug.Print "Drive="; Drv
Debug.Print "Vol name="; Drv.volumename
Debug.Print "ShareName="; Drv.sharename

"Patricia Shannon" wrote:

We have user manuals (each chapter on a separate file) on a server.
We have printed versions in binders for people to use.
I would like to put the name of the file in the footer.
The problem is, the FILENAME field puts in the mapped name, eg., I:\
But some people might map it to another drive.
So when you are looking at the printed documents, people won't necessarily
know where to look.
We want to be able to put in the name that you see when you hover the cursor
above a hyperlink:
\\Server Name\Share Name\the rest of the file name

By putting the FILENAME field inside the HYPERLINK field, I got the format I
wanted. The problem is that the text is hard-coded to the name of the file
when these nested fields are created.
If the name of the file is changed, the hyperlink does change. You can see
it by holding the cursor over it.
But the text that is displayed and printed does not change.

Is there some fairly simple way and fast way I can do this.
I don't want to use VBA. There are almost 200 documents.
It needs to be automatic, that will work after my job ends at the end of
this month, and contractors come and go.

Thanks.