R
Ron
Hi all. The system that we have uses mounted directories. This means
that a client/matter number in the format of 12345/123 could be mounted
on any drive letter between L and Z. The other variable is that the
client/matter number could be mounted including the folder "BOOKS" or
not, ie 12345/123/BOOKS.
So, what I'm trying to do is open a folder, if it exists. First I want
to check whether the directory has been mounted on Drive L with the
whole 12345/123/BOOKS. If so, open the folder, if not, I check whether
only 12345/123 was mounted on drive L. If so, open the folder. I need
to do this for all the drive letters to see where the client/matter
directory is mounted.
There are already issues with my coding below as the folder will open
twice if the folder is mounted on Drive L. [PATH] is the value of the
full pathline as stored in a form's text box. I'm missing something
here and would appreciate any assistance.
Thanks,
-Ron
Private Sub openpath_Click()
Dim stpath As String
Dim fixedpath As String
Dim smallpath As String
fixedpath = Replace([Path], "/", "\")
smallpath = Mid([fixedpath], 17)
stpath = "L:\" & smallpath
If Not Dir(stpath, vbDirectory) = "" Then
Retval = Shell("explorer /e,/root, " & stpath, vbMaximizedFocus)
Else
smallpath = Mid([fixedpath], 11)
stpath = "L:\BOOKS" & smallpath
End If
If Not Dir(stpath, vbDirectory) = "" Then
Retval = Shell("explorer /e,/root, " & stpath, vbMaximizedFocus)
Else
MsgBox "Directory Does Not Exist or Is Not Mounted", vbOKOnly,
"Warning..."
End If
End Sub
that a client/matter number in the format of 12345/123 could be mounted
on any drive letter between L and Z. The other variable is that the
client/matter number could be mounted including the folder "BOOKS" or
not, ie 12345/123/BOOKS.
So, what I'm trying to do is open a folder, if it exists. First I want
to check whether the directory has been mounted on Drive L with the
whole 12345/123/BOOKS. If so, open the folder, if not, I check whether
only 12345/123 was mounted on drive L. If so, open the folder. I need
to do this for all the drive letters to see where the client/matter
directory is mounted.
There are already issues with my coding below as the folder will open
twice if the folder is mounted on Drive L. [PATH] is the value of the
full pathline as stored in a form's text box. I'm missing something
here and would appreciate any assistance.
Thanks,
-Ron
Private Sub openpath_Click()
Dim stpath As String
Dim fixedpath As String
Dim smallpath As String
fixedpath = Replace([Path], "/", "\")
smallpath = Mid([fixedpath], 17)
stpath = "L:\" & smallpath
If Not Dir(stpath, vbDirectory) = "" Then
Retval = Shell("explorer /e,/root, " & stpath, vbMaximizedFocus)
Else
smallpath = Mid([fixedpath], 11)
stpath = "L:\BOOKS" & smallpath
End If
If Not Dir(stpath, vbDirectory) = "" Then
Retval = Shell("explorer /e,/root, " & stpath, vbMaximizedFocus)
Else
MsgBox "Directory Does Not Exist or Is Not Mounted", vbOKOnly,
"Warning..."
End If
End Sub