Hi Neil,
The program below is comparing strings and you need to compare numeric values.
The TRANSFORM() command takes any data type and returns a string, hence your need to add quotes around 500000. Change this line:
IF transform(loFile.Size)<='500000'
to
IF loFile.Size <= 500000
and it will compare both sides as numeric and give you the answer you require.
I have used the following function but I keep getting the Messagebox stating It is not OK when my file is only 79KB. Any ides?
loFSO = Createobject("Scripting.FileSystemObject")
filepath = 'U:\questpdm\picture\whatever.jpg'
loFile = loFSO.Getfile(filePath)
IF transform(loFile.Size)<='500000'
MESSAGEBOX("File Size is OK")
ELSE
MESSAGEBOX("File Size is not OK")
ENDIF
I should be getting the message "File Size is OK"
Neil Lewis
IT R&D Manager
Velmore Ltd