AddressBookData
From Real Software Documentation
| This class is only available on the OS X platform. For cross-platform development, use #If...#Endif with the Target... specifiers to make sure you will not attempt to use this class on an incompatible platform. |
Used to manage Address Book fields that store multiple values, such as phone and fax numbers.
| Methods | ||||||||||
|
Class Constants
The following class constants can be used to specify the Label parameter of the Insert method.
| Constant | Description |
|---|---|
| LabelHome | Home |
| LabelHomeFax | Home Fax |
| LabelMain | Main |
| LabelMobile | Mobile phone |
| LabelOther | Other |
| LabelPager | Pager |
| LabelWork | Work |
| LabelWorkFax | Work Fax |
Examples
The AddressBookData class can be used to get more information about a field (AddressBookContact properties). The Name method returns the property it represents. The Label method will return what kind of property it is, like Home, Work, etc. The Label property is relevant only for AddressBookData objects that can contain multiple values.
This example gets the user's phone numbers and displays them in a two-column ListBox. The first column displays the label ("Home", "Work", "Mobile", etc.) and the second column shows the phone number.
Dim data as AddressBookData
Dim c,i as Integer
data = Book.CurrentUser.PhoneNumbers
c=Data.count-1
If data.Count > 0 then
For i=0 to c
ListBox1.Addrow Data.Label(i)
ListBox1.Cell(ListBox1.LastIndex,1)=Data.Value(i)
next
Else
MsgBox "No phone numbers!"
End if
This method uses the Value method to get the current user's first email address.
Dim myContact as AddressBookContact
book=System.AddressBook
myContact=Book.CurrentUser
MsgBox myContact.emailAddresses.Value(0)
See Also
AddressBook, AddressBookAddress, AddressBookContact, AddressBookGroup, AddressBookRecord classes.
