Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Extracting an OLE Word Document from a General Field
Message
From
02/03/1998 10:55:01
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00081929
Message ID:
00082084
Views:
43
>>This is wrong. You could do it with only VFP if you could embed it (that is if the host already exist on the system) in VFP. No need to open by dblclick and choose SaveAs. Word docs could be saved via OLEAutomation using word.basic or word.application (Office97). Since you have a reference to an OLEBoundControl (word object) on a form you could use object's PEM. No need to createobject(), object is there and have a reference to it.
>>
>>* Assuming you have an embedded word doc, and on a form it's olbWf (OLEBoundControl)
>>ThisForm.olbWf.object.saveas("cetins.doc")
>>
>>For a more detailed example see "Interacting with word using word.basic" in KB\FAQ section.
>>cetin
>
>Cetin,
>
>Before you declare an answer as wrong, first read the original question. There was no mention of any fomr having an OLEBoundControl. The question was simply how to get a word document out of a general field. In fact you CANNOT get anything out of a general field. You can only save a copy of it and then blank the general field out. General fields are one way things, you can put stuff in but you can't get it back out without using the server application.
>
>Please don't jump in with a declaration of this is wrong unless you know for sure it is.
Sory Jim,
Caught with my English. I got the original question as "is it possible to get a copy of word doc embedded w/o user intervention when word exist on system". I thought, creating a form without showing it, was a way.
use wtest  && Fields oType c, oSelf g
locate for oType = "Word doc"
oform = createobject("form")
with oForm
 .addobject("olbW","Oleboundcontrol")
 .height = 420
 .width = 620
 .olbW.top = 0
 .olbW.left = 400
 .olbW.height = 400
 .olbW.width = 600
 .olbW.controlsource = "wtest.oSelf"    && Embedded word doc
 .olbW.object.saveas("c:\temp\acopy.doc",)
 .release
endwith
Cetin
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform