version 3.5
OLE_Insert file (oleArea; fileName) Integer
| Parameter | Type | Description | |
| oleArea | Longint | OLE Area Reference number | |
| fileName | String | Name of the file to insert | |
| Function result | Integer | Error code |
Description
The command OLE_Insert file 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