AddressBook.Add

From Xojo Documentation

Revision as of 19:05, 3 September 2020 by THill (talk | contribs) (Text replacement - "{{Deprecated" to "{{DeprecatedItem")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!
Method


AddressBook.Add(Record as AddressBookRecord)

Supported for all project types and targets.

Adds the record to the Address Book.

Sample Code

The following code adds a new contact to the address book.

Dim book As New AddressBook
Dim myContact As AddressBookContact
book = System.AddressBook
myContact = New AddressBookContact

myContact.FirstName = "Xena"
myContact.LastName = "Smith"
myContact.CompanyName = "Xanadu"
myContact.JobTitle = "Free Lance"

book.Add(myContact)

If book.HasUnsavedChanges Then
If book.Save Then
MsgBox("The AddressBook was saved!")
End If
Else
MsgBox("There were no unsaved changes!")
End If