AddressBookData

From Xojo Documentation
Jump to: navigation, search

Class (inherits from Object)


Used to manage Address Book fields that store multiple values, such as phone and fax numbers.

Methods
ActualLabel Name
Append Remove
Count Text
Insert Value
Label Value


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 book as New AddressBook
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 book as AddressBook
Dim myContact as AddressBookContact
book=System.AddressBook
myContact=Book.CurrentUser
MsgBox myContact.emailAddresses.Value(0)


See Also

AddressBook, AddressBookAddress, AddressBookContact, AddressBookGroup, AddressBookRecord classes.

Personal tools
Namespaces

Variants
Actions
Main
Content
Starting Out
Dig Deeper
More Help
Toolbox
About