4D v13

OLE_Insert file

Home

 
4D v13
OLE_Insert file

OLE_Insert file 


 

OLE_Insert file ( oleArea ; fileName ) -> Function result 
Parameter Type   Description
oleArea  Longint in OLE Area Reference number
fileName  String in Name of the file to insert
Function result  Integer in Error code

The OLE_Insert file command inserts the document fileName into the OLE area specified by oleArea. This command is equivalent to choosing the Create from file option from the standard Insert Object dialog box.

You can pass in fileName the "short" name of the document (if it is located in the database directory), or the full pathname to the document.

If the insertion is correctly performed, the function returns 0 (zero.) Otherwise it returns a Windows operating system error.

Example  

The following method inserts a Microsoft Excel document into the OLE area Idea:

 $DocRef :=Open document("";"XLS")
 If(OK=1)
    CLOSE DOCUMENT($DocRef)
    $errCode :=OLE_Insert file(Idea;Document)
    If($errCode#0)
       ALERT("OLE error #"+String($errCode))
    End if
 End if

 
PROPERTIES 

Product: 4D
Theme: OLE_Tools Commands
Number: 64993

 
INDEX

Alphabetical list of commands

 
HISTORY 

Created: < 4D v6