G
Guest
I got the code below from the Access newsgroup. It works fine for filenames
like c:\temp but I need to pass a file name formatted like
\\sec-app-test\images\img1.tif. Any help would be appreciated.
Public Function DirSize&(Optional sDir$, Optional sMask$ = "*.*")
Dim n&, sFile$
If sDir = vbNullString Then
sDir = VBA.CurDir$
End If
'If VBA.Right$(sDir, 1) <> Application.PathSeparator Then
' sDir = sDir & Application.PathSeparator
'End If
sFile = VBA.Dir$(sDir & sMask)
Debug.Print "sFile = ", sFile, "sDir =", sDir
While sFile <> vbNullString
n = n + VBA.FileLen(sDir & sFile)
sFile = VBA.Dir$()
Wend
DirSize = n
End Function
like c:\temp but I need to pass a file name formatted like
\\sec-app-test\images\img1.tif. Any help would be appreciated.
Public Function DirSize&(Optional sDir$, Optional sMask$ = "*.*")
Dim n&, sFile$
If sDir = vbNullString Then
sDir = VBA.CurDir$
End If
'If VBA.Right$(sDir, 1) <> Application.PathSeparator Then
' sDir = sDir & Application.PathSeparator
'End If
sFile = VBA.Dir$(sDir & sMask)
Debug.Print "sFile = ", sFile, "sDir =", sDir
While sFile <> vbNullString
n = n + VBA.FileLen(sDir & sFile)
sFile = VBA.Dir$()
Wend
DirSize = n
End Function