Consulting

Results 1 to 3 of 3

Thread: Get filepath including root server/volume?

  1. #1
    VBAX Mentor clhare's Avatar
    Joined
    Mar 2005
    Posts
    470
    Location

    Get filepath including root server/volume?

    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:

    [vba]strTemplateName = ActiveDocument.AttachedTemplate.Path[/vba]

    Thanks!

  2. #2
    VBAX Mentor clhare's Avatar
    Joined
    Mar 2005
    Posts
    470
    Location
    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.

  3. #3
    VBAX Regular
    Joined
    Jul 2008
    Posts
    67
    Location
    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 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...workdrives.htm

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •