-
Mapping a drive is something you can do in Windows Explorer, manually or automatically via another script... and say you have a network location which is
\\mynetworkshare\afolder\asubfolder\
You can "map" to that network location, and call it the J:\ drive (or all the way up to Z:\). Some mapped drives are hard coded (like A:\ and B:\ traditionally used for floppy drives, C:\ as the hard drive, D:\ and maybe E:\ as CD-ROM drives, etc etc). If you have any network drives (usually something from F:\ or G:\ on up), then you'll see what the "true" path to those network drives is.
If you had a really long location, even if it was already a mapped drive, you could map to the new location...
for example:
F:\subfolder\anothersubfolder\anotherlongsubfoldernamewhichisentirelyridicu lous\shortsub
You could map your Z:\ to be all the way to that ShortSub folder at the end... and then any code could reference the Z:\ in order to get around long file name limitations. I'm sure you could do this in some fashion from VBA, but I'd be a little hesitant to do it dynamically as it could be slow, and network engineers generally like to own the mapping of network drives.
Incidentally, if this is a major company-wide problem in terms of really deeply nested sub folders without the use of mapped drives... you've got bigger issues. Seriously. You'll be unable to perform certain kinds of network backups and a host of other issues far beyond the scope of this thread.
You can use the FileSystemObject scripting to detect whether a file exists or not-- whether it is "locked" (i.e., open by someone else) is a separate issue, although I don't think that matters, since we're talking about saving a document not opening a document. There are a lot of different ways to detect whether a file exists, try searching on it. My only readily available code on that is buried in a class object I re-use in all my projects.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules