Hi,
Your problem is storing the object in a general field. You need to store it in a binary memo field (codepage=0) and then use Automation to extract it into a file that can be read:
** VBA Code
Dim oVFP as Object
Set oVFP = CreateObject("VisualFoxPro.Application")
oVFP.DoCmd "USE mytable" && Open table
oVFP.DoCmd "LOCATE FOR ..." && Find the record
oVFP.DoCmd "COPY MEMO memofield TO c:\temp\test.vsd"
Now you can do what you want with the file.
>Dear all,
>
>I create a general field to store a ole object (such as a Visio Drawing). I would like to port this object and other data to the excel for printing the report. I try to record a marco on excel (create a ole object on worksheet) and port the code on VFP. But it doesn't work and prompt the error message "Object cannot add", command is work to run on excel. Comamnd as "activesheet.oleobjects.add(FileName:='c:\temp\test.vsd', Link:=False, DisplayAsIcon:=False).select".
>
>What problem on it and how can I print the object? Thank you very mcuh ...
>
>Best Regards,
>
>Justy Chow
>
justychow@sinaman.com
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05