Description
Inserts a new object of the specified OLE class in an OLE control.
Syntax
ole2control.InsertClass ( classname )
Argument |
Description |
---|---|
ole2control |
The name of the OLE control in which you want to create a new object |
classname |
A string whose value is the name of the class of the object you want to create |
Return value
Integer. Returns 0 if it succeeds and one of the following negative values if an error occurs:
-1 -- Invalid class name
-9 -- Other error
If any argument's value is null, InsertClass returns null.
Usage
Classnames are stored in the Registration database. Examples of classnames include:
Excel.Sheet
Excel.Chart
Word.Document
Examples
This example inserts an empty Excel spreadsheet into the OLE control, ole_1:
integer result result = ole_1.InsertClass("excel.sheet")
See also