Generates the extension object for an associated controlling extensible object (CEO) and extensible object (EO).
HRESULT IVba::CreateExtension(punkOuter, punkBase, punkExtender, ppunkExtension);IUnknown *punkOuter
IUnknown *punkBase
IUnknown *punkExtender
IUnknown ** ppunkExtension
Parameters
- punkOuter
- CEO IUnknown.
- punkBase
- EO IUnknown.
- punkExtender
- Reserved. Not used in this version of VBA.
- ppunkExtension
- The IUnknown interface for the extension object.
Return Value
The returned HRESULT value is one of the following:
| Return value | Meaning |
|---|
| S_OK | Success. |
| E_OUTOFMEMORY | Out of memory. |
| E_INVALIDARG | One or more parameters are invalid. |
Comments
It is not required that you set the extension using IVbaProjItem::SetExtension until you are expecting code to execute or the host is in a state where code might execute. For example, an event could fire where there is code behind it. This action associates an extension, a CEO and EO, with a document project item and the relevant document site.
IVba::CreateExtension can be called before a project is loaded or created.