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
Assembly: Microsoft.Office.Interop.InfoPath (in microsoft.office.interop.infopath.dll)

Syntax

'Declaration
'Usage

Property Value

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 12.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.

Example

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.Application app = 
   new Microsoft.Office.Interop.InfoPath.ApplicationClass();

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

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

Dim app As New Microsoft.Office.Interop.InfoPath.ApplicationClass

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

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

See Also

Reference

_Application3 Interface
_Application3 Members
Microsoft.Office.Interop.InfoPath Namespace