<< Click to Display Table of Contents >> UserProperties (collection) |
Access path: Application à UserProperties
1 Description
The UserProperties collection contains all components of the user's address (as entered on the General tab in the dialog box of the ribbon command File | Options).
The individual elements of this collection are of the type UserProperty.
2 Access to the collection
There is exactly one instance of the UserProperties collection during the whole runtime of TextMaker. It is accessed through Application.UserProperties:
' Show the first UserProperty (the user's name)
MsgBox tm.Application.UserProperties.Item(1).Value
3 Properties, objects, collections and methods
Properties:
▪Count R/O
Objects:
▪Item → UserProperty (default object)
▪Application → Application
▪Parent → Application
Count (property, R/O)
Data type: Long
Returns the number of UserProperty objects in the collection, i.e. the number of components in the user's address (name, street, etc.).
This value is constantly 18, since there are exactly 18 such elements.
Item (pointer to object)
Data type: Object
Returns an individual UserProperty object that you can use to get or set an individual component of the user's address (name, street, etc.).
Which UserProperty object you get depends on the numeric value that you pass to Item. The following table shows the admissible values:
smoUserDataTitle = 1 ' Title
smoUserDataName = 2 ' Name
smoUserDataInitials = 3 ' Initials
smoUserDataCompany = 4 ' Company
smoUserDataDepartment = 5 ' Department
smoUserDataAddress1 = 6 ' Address field 1
smoUserDataAddress2 = 7 ' Address field 2
smoUserDataZip = 8 ' Postal code
smoUserDataCity = 9 ' City
smoUserDataCountry = 10 ' Country
smoUserDataPhone1 = 11 ' Phone 1
smoUserDataPhone2 = 12 ' Phone 2
smoUserDataPhone3 = 13 ' Phone 3
smoUserDataFax = 14 ' Fax
smoUserDataEmail1 = 15 ' E-mail address 1
smoUserDataEmail2 = 16 ' E-mail address 2
smoUserDataEmail3 = 17 ' E-mail address 3
smoUserDataWebsite = 18 ' Website
Examples:
' Show the name of the user
MsgBox tm.Application.UserProperties.Item(1).Value
' Change e-mail address 2 to test@example.com
With tm.Application
.UserProperties.Item(smoUserDataEmail2).Value = "test@example.com"
End With
Application (pointer to object)
Data type: Object
Returns the Application object.
Parent (pointer to object)
Data type: Object
Returns the parent object, i.e. Application.