Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
General field and extracting its data
Message
From
10/12/2009 22:59:12
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
General field and extracting its data
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01438533
Message ID:
01438533
Views:
100
I have a table which contains a general field. That field holds a DOC, PDF or an Excel file. I need to extract that content and save that to disk. What would be the easiest approach to do that?

For now, I am using the approach as mentioned in Message #1232305. However, this returns an empty value for the .oleclass property on all the records. And, on all the records I have obtained, there is a file in the general field. Here is the code once again:
*Procedure YGeneral_PrintWord
* assuming there is a table having General field lcfile and there is a WORD document, embedded

close all
use MyTable
Genfiedname="z_data"

local oForm
oForm = Createobject('_Form')

SCAN
   MESSAGEBOX(STR(RECNO()))
   WITH oForm.myOle1
      ControlSource = ALIAS()+'.'+GenfiedName
	   IF .oleclass="Word.Document"
		   * set the control size properly; 
   		   *  otherwise the document paper size may be not properly inherited.
                                              .width=600  
		   .height=800
		   .object.Activate
		   .object.PrintOut(0)
     	ELSE
	    	?"?  OLeclass: ", .oleclass
    	endif	
   ENDWITH
ENDSCAN

=oForm.Release()
RETURN
*-------------------------------------------------------------------
Define Class _Form As Form
	PROCEDURE iNIT
		this.addobject('myOLe1',"OleBoundControl")
	ENDPROC
Enddefine
close all
I simply took the one from Message #1232305 and adjusted it so it would scan the records and print the .oldclass property value.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Next
Reply
Map
View

Click here to load this message in the networking platform