AddIn.RequestService Method (2007 System)
Returns an object that extends a feature in the 2007 Microsoft Office system.
Namespace: Microsoft.Office.Tools
Assembly: Microsoft.Office.Tools.Common.v9.0 (in Microsoft.Office.Tools.Common.v9.0.dll)
Syntax
'Declaration
Protected Overridable Function RequestService ( _
serviceGuid As Guid _
) As Object
'Usage
Dim serviceGuid As Guid
Dim returnValue As Object
returnValue = Me.RequestService(serviceGuid)
protected virtual Object RequestService(
Guid serviceGuid
)
protected:
virtual Object^ RequestService(
Guid serviceGuid
)
protected function RequestService(
serviceGuid : Guid
) : Object
Parameters
serviceGuid
Type: System.GuidA Guid that identifies an extensibility interface that is supported by applications in the 2007 Microsoft Office system.
Return Value
Type: System.Object
An object that implements the extensibility interface that is identified by serviceGuid.
Remarks
Override this method in an application-level add-in to implement an extensibility interface that extends a feature in the 2007 Microsoft Office system. For more information, see Customizing UI Features By Using Extensibility Interfaces.
When you override this method, check the value of the serviceGuid parameter to determine which extensibility interface is being requested, and then return an object that implements the interface. When your add-in is loaded, the Visual Studio Tools for Office runtime calls RequestService one or more times for each interface that is supported by the application, and it sends the return value to the Microsoft Office application that is loading your add-in. For more information about the load process of add-ins, see Architecture of Application-Level Add-Ins.
Note
If you are customizing the Ribbon UI by creating your own implementation of the Microsoft.Office.Core.IRibbonExtensibility interface or by adding a Ribbon (XML) item to your project, you can alternatively override the CreateRibbonExtensibilityObject method instead of the RequestService method. For more information, see Ribbon Overview and Ribbon XML.
Examples
For a code example that demonstrates how to implement an extensibility interface and override the RequestService method, see Customizing UI Features By Using Extensibility Interfaces.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
Microsoft.Office.Tools Namespace