OLE_Insert file

4D - Documentation   Français   English   German   OLE_Tools, Contents   OLE_Tools, Index   Back   Previous   Next

version 3.5


OLE_Insert file (oleArea; fileName) Integer

ParameterTypeDescription
oleAreaLongintOLE Area Reference number
fileNameStringName of the file to insert
Function resultIntegerError 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

4D - Documentation   Français   English   German   OLE_Tools, Contents   OLE_Tools, Index   Back   Previous   Next