IF OpenFIle <> Nil THEN
Pic = Picture.Open(OpenFile)
Pic = ResizeToFit(Pic,ImageWell1.WIdth, ImageWell1.Height)
ImageWell1.Image = Pic
ELSE
MsgBox (“Bad File Name”)
END IF[/code]
I have confirmed through MsgBox that the path and file name are correct, but the GetFolderItem returns Nil. The code trips the MsgBox at the end - Bad File Name. Nothing seems to work. Any help would be appreciated.
Did you check that the ThisPathName refers to a real folder?
Where do you get ThisPathName from?
Try:
dim parnt as folderitem = getfolderitem(ThisPathName)
if parnt = nil then
msgbox "Dont like that path!"
else
OpenFile = parnt.child(ThisFileName)
if openfile <> nil and openfile.exists then
Pic = Picture.Open(OpenFile)
Pic = ResizeToFit(Pic,ImageWell1.WIdth, ImageWell1.Height)
ImageWell1.Image = Pic
else
msgbox "Dont like the file!"
end if
end if