InsertFile

Description

Inserts an object into an OLE control. A copy of the specified file is embedded in the OLE object.

Syntax

olecontrol.InsertFile ( filename )

Argument

Description

olecontrol

The name of the OLE control.

filename

A string whose value is the name of the file whose contents you want to be the data in the embedded OLE object. Filename should include the file's path.


Return value

Integer. Returns 0 if it succeeds and one of the following negative values if an error occurs:

-1 -- File not found

-9 -- Other error

If any argument's value is null, InsertFile returns null.

Usage

The contents of the specified file is embedded in the OLE object. There is no further link between the object in PowerBuilder and the file.

Examples

This example creates a new OLE object in the control ole_1. It is an Excel object and contains data from the spreadsheet EXPENSE.XLS:

integer result
result = ole_1.InsertFile("c:\xls\expense.xls")

See also

InsertClass

InsertObject

LinkTo

Paste