Export (0) Print
Expand All

Permission.Enabled property

Gets or sets whether the permission settings represented by the Permission object are enabled for the current form.

Namespace:  Microsoft.Office.InfoPath
Assembly:  Microsoft.Office.InfoPath (in Microsoft.Office.InfoPath.dll)

'Declaration
Public MustOverride Property Enabled As Boolean
	Get
	Set
'Usage
Dim instance As Permission
Dim value As Boolean

value = instance.Enabled

instance.Enabled = value

Property value

Type: System.Boolean
True if the permission settings are enabled; otherwise false.

Use the Enabled property to determine whether permissions are restricted on the active form, and to enable or disable permissions. Set Enabled to false to disable permissions and to remove all users, other than the form author, and their permissions.

NoteNote

In preview mode, the Enabled property will always return false, and if code attempts to change this setting, a System.Runtime.InteropServices.COMException is raised and the message "The property/method is not available in preview mode" is returned.

This member can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.

This type or member can be accessed only from code running in forms opened in Microsoft InfoPath Filler.

In the following example, clicking the Button control displays whether permission settings are enabled for the current form.

Public Sub CTRL1_Clicked(ByVal sender As Object, _
   ByVal e As ClickedEventArgs)
   MessageBox.Show(Me.Permission.Enabled.ToString())
End Sub
Show:
© 2014 Microsoft