4D v13OLE_Insert file |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v13
OLE_Insert file
|
OLE_Insert file ( oleArea ; fileName ) -> Function result | ||||||||
Parameter | Type | Description | ||||||
oleArea | Longint |
![]() |
OLE Area Reference number | |||||
fileName | String |
![]() |
Name of the file to insert | |||||
Function result | Integer |
![]() |
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.
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
Product: 4D
Theme: OLE_Tools Commands
Number:
64993
Created: < 4D v6