Share via


_Application3.COMAddIns property

Gets a Microsoft.Office.Core.COMAddIns object containing information about the COM Add-ins registered for the current InfoPath application.

Namespace:  Microsoft.Office.Interop.InfoPath.SemiTrust
Assembly:  Microsoft.Office.Interop.InfoPath.SemiTrust (in Microsoft.Office.Interop.InfoPath.SemiTrust.dll)

Syntax

'Declaration
ReadOnly Property COMAddIns As Object
    Get
'Usage
Dim instance As _Application3
Dim value As Object

value = instance.COMAddIns
Object COMAddIns { get; }

Property value

Type: System.Object
A Microsoft.Office.Core.COMAddIns collection that contains information about the COM Add-ins registered for the current InfoPath application.

Remarks

The COMAddIns object returned by the InfoPath COMAddIns property is implemented in the Microsoft.Office.Core namespace. The Microsoft.Office.Core.COMAddIns object provides information about the collection of InfoPath COM add-ins that are registered in the Windows registry of the user's computer. To access the members of Microsoft.Office.Core namespace, you must first add a reference to the Microsoft Office 14.0 Object Library on the COM tab of the Add Reference dialog box in Visual Studio.

To use the COMAddIns property to access the Microsoft.Office.Core.COMAddIns object, you must cast the object returned by the InfoPath COMAddIns property to the Office COMAddIns type as shown in the code example.

Additionally, because the COMAddIns property is new to Microsoft InfoPath, you must also declare and cast to the _Application3 type to access this property. For more information, see How to: Use Microsoft.Office.Interop.InfoPath.SemiTrust Members That Are Not Compatible with InfoPath 2003.

This member can be accessed only by forms opened from a form template that has been configured to run with full trust using the Security and Trust category of the Form Options dialog box. This member requires full trust for the immediate caller and cannot be used by partially trusted code. For more information, see "Using Libraries from Partially Trusted Code" on MSDN.

Examples

The following example accesses the first item in the COMAddIns collection that is returned by the ComAddIns property.

object objectReference = 1;

Microsoft.Office.Interop.InfoPath.SemiTrust.Application app = 
   thisApplication;

Microsoft.Office.Core.COMAddIns myCOMAddIns = 
   (Microsoft.Office.Core.COMAddIns)((_Application3)app).COMAddIns;

Microsoft.Office.Core.COMAddIn myCOMAddIn = 
   myCOMAddIns.Item(ref objectReference);
Dim objectReference As Object = 1

Dim app As Microsoft.Office.Interop.InfoPath.SemiTrust.Application = _
   thisApplication

Dim myCOMAddIns As Microsoft.Office.Core.COMAddIns = _
   DirectCast(app, _Application3).COMAddIns

Dim myCOMAddIn As Microsoft.Office.Core.COMAddIn = _
   myCOMAddIns.Item(objectReference)

See also

Reference

_Application3 interface

_Application3 members

Microsoft.Office.Interop.InfoPath.SemiTrust namespace