just open a new project and follow the instructions below.'File Size' add a label named lblfilesize and a command button named as BtnShowPrivate Sub BtnShow _Click()Call ShowFileSize()End SubPrivate Sub ShowFileSize()Dim strFile As StringDim strSize As StringDim strMyDir As StringDim strMyFile As StringstrMyDir = "c:"strMyFile = "abc.txt"strFile = strMyDir & "\" & strMyFilestrSize = FileLen(strFile)lblfilesize.Caption = "The file " & strFile & " is " & _Format(strSize, "#,##0") & "Bytes in size."End Sub
just open a new project and follow the instructions below.
ReplyDelete'File Size
' add a label named lblfilesize and a command button named as BtnShow
Private Sub BtnShow _Click()
Call ShowFileSize()
End Sub
Private Sub ShowFileSize()
Dim strFile As String
Dim strSize As String
Dim strMyDir As String
Dim strMyFile As String
strMyDir = "c:"
strMyFile = "abc.txt"
strFile = strMyDir & "\" & strMyFile
strSize = FileLen(strFile)
lblfilesize.Caption = "The file " & strFile & " is " & _
Format(strSize, "#,##0") & "Bytes in size."
End Sub