PslSourceString.Property
Returns an internal or a custom property of the string.
Syntax
Expression.Property (Name as Variant) as Variant
Expression Object of type PslSourceString
Name Name of the property. One of the predefined values below or a custom name. If the macro sets a new value, the property name must be between 10000 and 19999 or start with "M:" (see below)
Predefined values are:
pslPropClass (Value = -7): Class of the string
pslPropExstyle (Value = -9): Extended style bits.
pslPropStyle (Value = -8): Style bits.
pslPropMaxLength (Value = -33): Max. length of translation string.
pslPropMaxLines (Value = -53): Max. number of lines for translation string
Custom Properties
Custom Properties can be defined by parser add-ins, a macro or the user. All properties are in the same list, so they all can be accessed. To distinguish the types, different property names are used. When setting a property the macro is responsible for using the correct name, otherwise the property may be removed when updating string lists.
| Type | Integer Name | String Name |
|---|---|---|
| Add-In properties | 1 - 9999 | No prefix |
| Macro properties | 10000 - 19999 | Uses prefix "M:" |
| User-defined properties | 20000 - 30000 | Uses prefix "U:" |
Example
Dim i As Long
Dim selcount As Long
Dim srcdisp As PslSourceDisplay
Set srcdisp = PSL.ActiveSourceDisplay
If Not srcdisp Is Nothing Then
selcount = srcdisp.StringCount(pslSelection)
For i = 1 To selcount
s.Property(10001) = "abc"
s.Property("M:myprop") = "def"
Next i
End If