AddIn.RequestComAddInAutomationService Method (2003 System)

Returns an object in your add-in that can be used by other loaded add-ins.

Namespace:  Microsoft.Office.Tools
Assembly:  Microsoft.Office.Tools.Common (in Microsoft.Office.Tools.Common.dll)

Syntax

'Declaration
Protected Overridable Function RequestComAddInAutomationService As Object
'Usage
Dim returnValue As Object

returnValue = Me.RequestComAddInAutomationService()
protected virtual Object RequestComAddInAutomationService()

Return Value

Type: System.Object
An object that you want to expose to other add-ins.

Remarks

Override this method to expose an object in your add-in to other loaded add-ins. When your add-in is loaded, the Visual Studio Tools for Office runtime calls this method and assigns the return value to the Object property of a COMAddIn object that represents your add-in. Other add-ins can then access this COMAddIn object by using the Application.COMAddIns property that is provided in the object model of every Microsoft Office application.

Your implementation of RequestComAddInAutomationService must return an instance of a class that meets the following requirements:

If the object you return does not meet these requirements, the Visual Studio Tools for Office runtime will throw an InvalidCastException after your implementation of the method is called.

The Visual Studio Tools for Office runtime calls RequestComAddInAutomationService before it calls the default ThisAddIn_Startup event handler in your add-in project. For more information about the ThisAddIn_Startup event handler, see Visual Studio Tools for Office Project Events.

Permissions

See Also

Reference

AddIn Class

AddIn Members

Microsoft.Office.Tools Namespace