PDA

View Full Version : Get filepath including root server/volume?



clhare
12-03-2009, 09:26 AM
Is there a way to get the filepath of the attached template, including the root server and volume instead of whatever drive letter I assigned to it?

I tried the following, but the string endings up starting with the drive letter and I need to know the full path:

strTemplateName = ActiveDocument.AttachedTemplate.Path

Thanks!

clhare
12-03-2009, 12:07 PM
What I am specifically trying to do is this. Find out the server name where the template being run is stored, put that in a string, then check the string to see if the server is SERVERA or SERVERB. Based on which server it is, I will save the ouput files in a specific folder on the correct server.

FhM
12-03-2009, 12:56 PM
I'm not sure you are going to be able to do what you want. Is this for new or exisiting documents? Are your drives mapped like x: = \\server1\share (file://\\server1\share) y:=\\server2\share or are you using DFS or similar ?
If I was doing it in VBScript I would be using something like this http://www.computerperformance.co.uk/Logon/LogonScript_enumnetworkdrives.htm

So you need to see if you can get the network object under VBA. The properties contain drive letter and mapped path.