AddObject Method

Adds an object to a Container object at run time.

Object.AddObject(cName, cClass [, cOLEClass] [, aInit1, aInit2 ...])



Specifies the name used to reference the new object.


Specifies the class of the object to add.


Specifies the OLE class of the object to add.


If you plan to distribute run-time applications which add ActiveX Controls requiring License key information (for example, Microsoft Treeview and Listview controls), you should not use the AddObject(.....cOLEClass) method. Instead, create and save a subclass of your ActiveX Control to a VCX class library. Then, at run time you can use the AddObject (or NewObject) method to add this OleControl class containing your control.

aInit1, aInit2

Specify parameters passed to the Init event of the new object.

Expand imageRemarks

Expand imageExample

Expand imageSee Also

© , 1996-2020 • Updated: 11/10/20
Comment or report problem with topic