Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Function MappedServerName(myPath As String) As String
Dim objWshNetwork As Object
Dim objCheckDrive As Object
Dim fso As Object
Dim lCheckDriveCounts As Long
Dim iCount As Long
Dim myServerName As String
MappedServerName = ""
Set objWshNetwork = CreateObject("WScript.Network")
Set objCheckDrive = objWshNetwork.EnumNetworkDrives()
lCheckDriveCounts = objCheckDrive.Count
Set fso = CreateObject("Scripting.FileSystemObject")
For iCount = 0 To lCheckDriveCounts - 1 Step 2
If Trim(UCase(objCheckDrive.Item(iCount)) & "") = fso.GetDriveName(myPath) Then
myServerName = UCase(objCheckDrive.Item(iCount + 1))
myServerName = Left(myServerName, InStrRev(myServerName, "\"))
myServerName = Replace(myServerName, "\", "")
MappedServerName = myServerName
Exit For
End If
Next iCount
Set fso = Nothing
Set objCheckDrive = Nothing
Set objWshNetwork = Nothing
End Function
Function MappedServerName(myPath As String) As String
Dim objWshNetwork As Object
Dim objCheckDrive As Object
Dim fso As Object
Dim lCheckDriveCounts As Long
Dim iCount As Long
Dim myServerName As String
MappedServerName = ""
Set objWshNetwork = CreateObject("WScript.Network")
Set objCheckDrive = objWshNetwork.EnumNetworkDrives()
lCheckDriveCounts = objCheckDrive.Count
Set fso = CreateObject("Scripting.FileSystemObject")
For iCount = 0 To lCheckDriveCounts - 1 Step 2
If Trim(UCase(objCheckDrive.Item(iCount)) & "") = fso.GetDriveName(myPath) Then
myServerName = UCase(objCheckDrive.Item(iCount + 1))
myServerName = Left(myServerName, InStrRev(myServerName, "\"))
myServerName = Replace(myServerName, "\", "")
MappedServerName = myServerName
Exit For
End If
Next iCount
Set fso = Nothing
Set objCheckDrive = Nothing
Set objWshNetwork = Nothing
If MappedServerName = "" Then
MappedServerName = Split(CurrentProject.Path, "\")(2)
End If
End Function