Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Inverse command to APPEND GENERAL
Message
From
24/07/1999 10:48:10
 
 
To
24/07/1999 09:49:00
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00245188
Message ID:
00245718
Views:
17
>Yes, I try use binary memo and it work O.K. I used command "append memo" and "copy memo". In help of VFP about "copy memo" is: "Copies the contents of the specified memo field in the current record to a text file." It copies not only text files, but all files to binary memo field. This information confuse me.
>I have another question. In your advice you write, that I can use Word as OLE server and open the file from generel field. Is there a way to open file in Word directly from general file, and after editing save in Word to the general field? I try use form with OLEBound object, it work fine, but I don't want use form, I want open file in Word directly from general field and then save file to general field. Without creating temporary file on harddisk.
>

Unfortunately, not if you're starting from Word, which is file-oriented in and of itself. It might be possible to write a VBA script to accomplish this.

In your application, why not write a class that copies out the file, runs Word against that file using something like ShellExecute() or my API_APPRUN class which can wait on termination of the started application, and then on return copies the file back. As a simple example, assuming that you're using API_APPRUN (this is a sample, and untested, but it should give you the general idea):
LOCAL cDocPath, oApp, aDocFileOriginal[1,5], aDocFileAfter[1,5],cWordPath
COPY MEMO mMyMemo TO Temp.DOC
cDocPath = FULLPATH('Temp.DOC')
cWordPath = '"C:\Program Files\Microsoft Office\Office\WINWORD.EXE"'
=ADIR(aDocFileOriginal,cDocPath)  && get the file details
*
*  You must specify the complete path to WINWORD and the document
*  in the command line you use to start Word using an API call or RUN.
*  You can extract Word's path via the FindExecutable() API call
*  or by looking up the location in the registry yourself.  I'm using
*  the path in the example only as an example - your copy may not be there
*
*  note - if there are embedded spaces in the path, you have to quote-
*  encapsulate the path(s) in the command line.  It's safe to do
*  regardless, so I just do it in all cases.  Don't do it beforehand
*  since VFP commands like ADIR() won't accept the path that way
*
oApp = CREATEOBJ('API_APPRUN',cWordPath + ' "' + cDocPath + '"',,'MAX')
* Run Word and don't return control to VFP until it finishes
oApp.LaunchAppAndWait()
*  Release the object - you don't need it any more
oApp = ''
=ADIR(aDocFileAfter,cDocPath)
IF aDocFileAfter[1,3] # aDocFileOriginal[1,3] OR ;
   aDocFileAfter[1,4] # aDocFileoriginal[1,4]  && date/time stamp change
   APPEND MEMO mMyMemo FROM (cDocPath)
ENDIF
ERASE (cDocPath)
>Maros Klempa
>
>>As far as I know there is no command or function to write out the contents of a general field. If you are only storing Word documents in it, than you can use Word as an OLE server and have Word open the file in the general field and save it to a disk file. The other option is if you don't need to have it in a general field use a binary memo field.
>
>>-Dug
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform