ISProfile.CreateReadOnlyModeReason

Description

This function creates read only mode reason.

Syntax

object.CreateReadOnlyModeReason(aDescription, aSource = "")

Part Attribute Type Description
object Required
The object always implements the ISProfile interface
aDescription In, Required
string
The description of the reason for turning on the read only mode
aSource In, Required
Default value is ""
string
The short information about the source of the read-only mode

Return Value

ISReadOnlyModeReason

Example

Display the reason why the window is displayed in the read only mode.

Dim aReasons, aReason
Dim aHelper
Dim aMessage
Dim i

set aReason = Profile.CreateReadOnlyModeReason("This form is too secure", "Info")
set aHelper = Form.ReadOnlyModeHelper
aHelper.AddReadOnlyModeReason(aReason)

set aReasons = aHelper.Reasons
aMessage = "There is/are " & aReasons.Count & " Readonly Reason(s):" & vbNewLine
for i = 0 to aReasons.Count - 1
  set aReason = aReasons.Item(i) 
  aMessage = aMessage & (i + 1) & ") " &_
    aReason.Description & " (" &  aReason.Source & ")" & vbNewLine
next 'i 

Profile.MsgBox(aMessage)
Note:

In Profile Client v8 on User Interface the macro should be executed on 'OnOpen' window event that is configured in Edit > Defaults > Macros.

Version information

Added in v7.8.0