Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    Terneuzen, Netherlands
    Posts
    895
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Network name (Word/excel 97/2000)

    In VBA, how to I get back the full network name i.s.o. the one with the mapped drives?

    If I do activesheet.fullname, I now get something like: F:subfilename.xls

    What I'd want would be: networksharesub1subfilename.xls


    Anyone?

    Thanks!!

  2. #2
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Network name (Word/excel 97/2000)

    You will need to use API calls to get the UNC of the drive F: Then you will need to append the rest of the path and file name.

    Have a look at API: Enumerating Local and Network Drives from the Access Web site.

    It's generic VBA code, so it's shouldn't be an issue putting it into Word or Excel.
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Network name (Word/excel 97/2000)

    You can also use the FileSystemObject (see <!post=Post #114962,114962>Post #114962<!/post> in Word). Although that might be easier to code, it might run slower than WinAPI and some people might have the Microsoft Scripting Runtime library disabled.

Posting Permissions

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