Partager via


APPEND GENERAL Command

Imports an OLE object from a file and places it into a general field.

APPEND GENERAL GeneralFieldName [FROM FileName] 
   [DATA cExpression] [LINK] [CLASS OLEClassName] 

Parameters

  • GeneralFieldName
    Specifies the name of the general field in which the OLE object is placed. You can specify a general field in a table open in a noncurrent work area by including the table alias with the field name.

  • FROM FileName
    Specifies the file containing the OLE object. You must include the entire file name, including its extension. If the file is located in a directory other than the current default directory, include the path with the file name.

  • DATA cExpression
    Specifies a character expression that is evaluated and passed as a character string to the OLE object in the general field. The OLE object must be capable of receiving and processing the string. For example, you cannot send a character string to a graphics object such as one created using Paintbrush.

  • LINK
    Creates a link between the OLE object and the file that contains the object. The OLE object appears in the general field but the object's definition remains in the file. If you omit LINK, the OLE object is embedded in the general field.

  • CLASS OLEClassName
    Specifies an OLE class for an OLE object other than the default class.

    You can specify a class name when the file extension for the file containing the OLE object is different from the default extension and you want to force the behavior for the class. If the default extension can be used by multiple Automation servers, include the class to specify a particular server.

Remarks

If an OLE object already exists in the general field, it is replaced with the OLE object from the file. To remove an OLE object from a general field, issue APPEND GENERAL GeneralFieldName (GeneralFieldName is the name of the general field to clear) without any additional arguments.

For additional information about OLE objects in Visual FoxPro, see Adding OLE.

Example

The following example imports a Microsoft Excel chart in the Excel directory to a general field named mygenfield.

CREATE TABLE MyGenTbl (mygenfield G)
APPEND BLANK  && Add a blank record
APPEND GENERAL mygenfield FROM C:\EXCEL\BOOK1.XLS CLASS EXCELCHART

See Also

@ ... SAY - Pictures & OLE Objects | MODIFY GENERAL | OLE Bound Control