Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
OLELinkedObject Question
Message
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00774418
Message ID:
00774794
Views:
13
You know.. sometimes if you have enough time on your hands and sit down long enough, you will type the declaration of independence...

Here's what I did in case anyone else wants to know...

Embedding a Word Document in a general field.

Create a general field in the database.
On the form, place an OLELinkedObject and tie it's control source to the general field.
Set the autoactivate to 0 (manual) to prevent a double click from opening Word. (unless you want it that way... I did not). (I don't even know if I can afford the realestate to have this control visible...)
Create a blank word document and save it as temp.doc
Note: You need to stick a word document in the general field so you need to have one available or create one on the fly. You can't just issue a "APPEND GENERAL myfield" without the FROM clause since that is how you remove the word document from the field. Whatever you put after the FROM is what type of document is placed in the field.
On the form place a Control or Container having the Word Icon. This is what I wanted to use to open WORD. In the click of it place...
IF EMPTY(mytable.myfield) .and. FILE("temp.doc")
APPEND GENERAL myfield FROM temp.doc
Thisform.oleboundcontrol1.Refresh
ENDIF
Thisform.oleboundcontrol1.DoVerb(1) && doverb(1) is the open instruction.

Have Fun...[:~}
Ron Seidl
Independent Developer
VFP

"I'm playing in life's theater in anticipation of a great cast party!"
Previous
Reply
Map
View

Click here to load this message in the networking platform