Option Explicit
Sub GetTheSize()
Dim sFilePath As String
sFilePath = ThisDocument.Path & "\Test Filesize.doc"
MsgBox GetTheFileSize(sFilePath) & " Kb"
End Sub
Public Function GetTheFileSize(sPath As String) As Long
Dim iChannel As Integer
iChannel = FreeFile
Open sPath For Input As iChannel
GetTheFileSize = Format((LOF(iChannel) / 1024), "#.0")
End Function
|