Private Declare Function WNetGetConnection Lib "mpr.dll" Alias "WNetGetConnectionA" (ByVal lpszLocalName As String, ByVal lpszRemoteName As String, cbRemoteName As Long) As Long
Public Function GetUNCPath(ByVal PathName As String) As String
Dim sUNCPath As String
sUNCPath = String(260, 0)
If WNetGetConnection(Left$(PathName, 2), sUNCPath, 260) = 0 Then
sUNCPath = Trim(Left(sUNCPath, InStr(sUNCPath, vbNullChar) - 1))
sUNCPath = sUNCPath & Mid$(PathName, 3)
End If
GetUNCPath = sUNCPath
End Function