Show All

# About ActiveX controls

You can host ActiveX controls in forms. These controls can be preexisting (with some constraints) or can be written specifically for InfoPath.

Write an ActiveX control

As with other controls in InfoPath, ActiveX controls should support existing Component Object Model (COM) interfaces:

- IDispatch
- IPersistPropertyBag
- IPersistStreamInit
- IPropertyPage
- IObjectSafety
- IPropertyNotifySink
- IViewObject
- IOleObject
- IOleInPlaceObject

In order for InfoPath to update properties in the Document Object Model (DOM) at the time they change in the control, the control should implement the following interfaces:

- IConnectionPointContainer
- IEnumConnectionPoints
- IConnectionPoint
- IEnumConnections

Two new COM interfaces have been added to provide tighter integration of controls:

- IInfoPathControl
- IInfoPathControlSite

For more information on these interfaces, see the Help for the InfoPath object model.

Add an ActiveX control to the InfoPath design environment

The Controls task pane allows you to use a wizard to add a custom control. With the wizard, you can:

- Select an ActiveX control that has already been registered.
- Specify a CAB to install the ActiveX control with a form.
- Specify a binding property to bind to the XML.
- Specify an enable or disable property, which can be useful, for example, when the XML is not present or when conditional formatting is used.
- Specify data type binding.

Deploy an ActiveX control

To distribute an ActiveX control, you can write an installer that installs the control on the target computer and copies the InfoPath Control Template (ICT) file and the CAB file to the user's folder, Local Settings\Application Data\Microsoft\InfoPath\Controls. Note that if two or more developers are collaborating on developing forms that use ActiveX controls, each developer should have the controls added to the InfoPath design environment, or they will not be able to modify the properties of the controls from within InfoPath.
©2003-2004 Microsoft Corporation. All rights reserved. Permission to copy, display and distribute this document is available at: http://msdn.microsoft.com/library/en-us/odcXMLRef/html/odcXMLRefLegalNotice.asp