From: Microsoft
The form can carry ActiveX controls. These controls can be ready-made (with certain constraints), or they can be specially written for infopath.
Compile ActiveX Controls
Like other controls in infopath, ActiveX controls should support the existing Component Object Model (COM) interface:
- Idispatch
- Ipersistpropertybag
- Ipersiststreaminit
- Ipropertypage
- IObjectSafety
- Ipropertypolicysink
- Iviewobject
- Ioleobject
- Ioleinplaceobject
To enable infopath to update attributes in the control when attributes in the Document Object Model (DOM) are changed, the control should implement the following interfaces:
- Iconnectionpointcontainer
- Ienumconnectionpoints
- Iconnectionpoint
- Ienumconnections
The following two new COM interfaces have been added to provide closer control integration:
- Iinfopathcontrol
- Iinfopathcontrolsite
For more information about these interfaces, see the infopath object model help.
Add ActiveX Control to infopath design environment
"Control"The task pane allows you to use"Add custom control wizard"To add custom controls. You can use this wizard:
- Select the registered ActiveX control.
- Specify the cab to install ActiveX controls with forms.
- Specify the binding property bound to XML.
- Enable or disable attributes that may be helpful. For example, when XML does not exist or conditional format is used.
- Specify data type binding.
| Note |
| If ActiveX control is developed and added to infopath"Control"In the task pane, ActiveX control cannot be rebuilt before infopath is disabled. |
Deploy ActiveX Controls
To distribute ActiveX controls, you can compile an installationProgramTo install the control on the target computer, and copy 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 developing forms using ActiveX controls in collaboration, each developer should have controls that have been added to the infopath design environment, otherwise, they cannot modify the properties of the control from the infopath.