By default, you can call a personal preference in scripting through the SystemUserOptions object, as: If SystemUserOptions.F_LastEdition <> 0 Then... This is based on the protected property SystemUserOptions that is declared in AdsDlg class of AdsDlg.vb, NewEditionDlg class of NewEdition.vb, EditionDesignerAddIn class of Edition.vb, Fred4MainAddIn class of Fred.vb, FredWindowAddIn class of Fred.vb, PageDesignerAddIn class of Page.vb, TxtDesignerBase class of Article.vb, Ted4MainAddIn class of Ted.vb and Ted4WindowAddIn class of Ted.vb. Protected Overloads ReadOnly Property SystemUserOptions() As EditorialSystemUserOptions Get Return DirectCast(WinUI.ApplicationBase.Current.SystemUserOptions, EditorialSystemUserOptions) End Get End Property In other classes, SystemUserOptions may be not accessible. In that case, declare it in the body of the procedure as: Dim systemUserOptions As EditorialSystemUserOptions = DirectCast(WinUI.ApplicationBase.Current.SystemUserOptions, EditorialSystemUserOptions) |
In custom scripts, you can use CustomUserOptions, defined in the CustomTedOptions.vb with line such as : <XmlAttribute()> Public T_LastSaveAsFolderId As Integer = 0 as shown on the following screenshot: Then, the call to the stored value is by (in the below example, we're re: variable = CustomUserOptions.T_LastSaveAsFolderId and the saving of the value goes as: CustomUserOptions.T_LastSaveAsFolderId = value |
First, choose where to define new option: •For system add-ins, do it in the TedOption.vb add-ins file: •For custom add-ins, to it in the CustomTedOptions.vb add-ins file: |
Define new options in a new line, such as: <XmlAttribute()> Public T_OnDropCaller As String = "" <XmlAttribute()> Public chkT_EscExitEditing As Boolean = True <XmlAttribute()> Public FredCaptionHeight As Integer = 0 <XmlAttribute()> Public F_SelBox As Short = -1 |