_Application3.COMAddIns Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets a Microsoft.Office.Core.COMAddIns object containing information about the COM Add-ins registered for the current InfoPath application.
public:
property System::Object ^ COMAddIns { System::Object ^ get(); };
public object COMAddIns { get; }
member this.COMAddIns : obj
Public ReadOnly Property COMAddIns As Object
Property Value
A Microsoft.Office.Core.COMAddIns collection that contains information about the COM Add-ins registered for the current InfoPath application.
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)
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)
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 Object Model 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.