Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

displaying picture in OLE Object; need to detect a maximum size

Status
Not open for further replies.

netooi25

Programmer
Jul 30, 2004
25
US
I have an Access form that I want to display a image in as an OLE Object.

However, I want to be able to restrict the maximum size of the image (say to 100kb or something for example). Is there a way to check the size before displaying and if it is too large, then i'll give an appropriate message to the user.

Also, would it be possible to perhaps convert the image (like from a bitmap to a jpeg or gif) before displaying

Thanks for any help.
Netooi
 
Hi
How about the File System Object. Taken from Access help file:
Size Property
For files, returns the size, in bytes, of the specified file. For folders, returns the size, in bytes, of all files and subfolders contained in the folder.

Code:
Sub ShowFolderSize(filespec)
    Dim fs, f, s
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set f = fs.GetFolder(filespec)
    s = UCase(f.Name) & " uses " & f.size & " bytes."
    MsgBox s, 0, "Folder Size Info"
End Sub

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top