Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP to Word
Message
 
To
01/12/1998 11:19:27
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00162743
Message ID:
00163219
Views:
24
Cetin,

it took me the whole day to figure it out but I just couldn't get your routine to work. After many hours of struggling I found the difference.

When filling my table with pictures I opened the bmp's in PaintShopPro and copied and pasted them to the general field. It showed allright so I assumed that everything worked correctly.

After examining the temporary file created by your routine I noticed that PSP was not able to open it. This made me wonder...
The clipboard wasn't giving me any problems so it had to be somewhere else.
I copied the pictures one by one to the clipboard and pasted them into PSP. From PSP I saved the individual files.

I than went back to VFP, created a new field in my table. Opened the general field, selected insert object and inserted the files.

Having done this your routine worked like a charm. In other words: pasting a picture is not the same as inserting it as an object...

It took a while to figure out but I couldn't have done this without your routine.

Thanks.

Regards,

Ron Brahma




>>I'm building an application in VFP that needs to create a report with a lot of fields (over 300). VFP's report-writer is giving me a very hard-time due to limitions on the number of fields that it can handle in the report. For that reason I have decided to use Word.
>>
>>When inserting data into Word, however, I have the problem with a General field. The field itself contains a bitmap (a very small one) but I can't find a way of getting the picture from VFP to Word.
>>
>>Someone suggested to save the contents of the General field to a temporary-file and to 'insert' the file into my Word document.
>>Sounds great...but how do I save the content of a General field into a file. There is no such function like 'copy general to file .
>>
>>Has anyone been able to solve 'my problem'?
>>
>>Thanks in advance,
>>
>>Ron Brahma
>Ron,
>Someone directed me to MS KB for it some time ago. According to KB, if you copy just one rec with that gen field to another temp file you can extract it from there.
>Copy next 1 fields mygen to mytemp
>Now using lowlevel you could get the bmp as file. Strip 599 bytes from the beginning (MS's warning : Sometimes extracted file is actually a duplication to real BMP -says when Ctrl+C/V used for gen field but it was not the case on my trials).
handle=fopen("mytemp.fpt")
>handleout=fcreate("mypic.bmp")
>=fseek(handle,599)
>do while !feof(handle)
>   =fwrite(handleout, fread(handle,512),512)
>enddo
>=fclose(handle)
>=fclose(handleout)
I'm currently working on a similar FLL :)
>Cetin
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform