Image of VFP
At first I should appreciate you guys help.
I indeed want to save pictures of image into a database and get them out
freely, then put them on an Excel sheet as a report.
But I cannot paste them, and also cannot control the size of the picture
on the sheet.
[282 byte] By [
Ian] at [2007-11-10 12:49:42]

# 1 Re: Image of VFP
Hi Ian,
I haven't worked extensively with pictures but many people prefer keeping
the pictures in separate files and keeping their names in a table. Once
you've got the name you can insert them into your spreadsheet with code
like:
oExcel.Visible = .T. && For testing.
oBook = oExcel.Workbooks.Add()
oSheet = oExcel.ActiveSheet
oSheet.Range("B2").Select()
*!* The Select in the next leaves the picture selected, not the cell.
oSheet.Pictures.Insert("C:\MyPicture.jpg").Select()
oExcel.Selection.ShapeRange.LockAspectRatio = -1 && msoTrue
oExcel.Selection.ShapeRange.Height = 150
*!* Width will adjust due to LockAspectRatio
*!* oExcel.Selection.ShapeRange.Width = 150
--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
cindy.winegarden@mvps.org, www.cindywinegarden.com
"Ian" <Ianwangxy@hotmail.com> wrote in message
news:3ee27dcb$1@tnews.web.dev-archive.com...
> I indeed want to save pictures of image into a database and get them out
> freely, then put them on an Excel sheet as a report.
>
> But I cannot paste them, and also cannot control the size of the picture
> on the sheet.
>