Enable Method

Microsoft Office InfoPath

Defines a method that must be provided by the developer for InfoPath to call when it needs to enable or disable an instance of the control in a view.

expression.Enable(vfEnabled As Boolean)

expression    Required. An expression that returns a reference to the InfoPathControl object.

vfEnabled    Required. A Boolean value that specifies whether the control is enabled.

Remarks

InfoPath will call the Enable method to enable or disable the control, such as when the view is being refreshed or closed, when the document is signed and should not be edited, or when rules are applied to the form that must disable the control.

The InfoPathControl and InfoPathControlSite objects and their methods and properties are designed to be used only from the implementation of an ActiveX control. These objects and their members are not supported in InfoPath form code. For more information on how to create ActiveX controls that work with InfoPath, see the InfoPath Developer Center.

Note   This object model member is not supported when the Disable Service Pack features option on the Advanced tab of the Options dialog box in InfoPath is selected or when Microsoft Office 2003 Editions Service Pack 1 or later is not installed. Any form template that contains a view with an ActiveX control that implements this object model member in its code will generate an error message if it is opened in InfoPath when service pack features are disabled or unavailable.