Home > Domino Tips > Administrator > Address Book > Agent To Export Address Book Info In Palm Format
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ADDRESS BOOK

Agent To Export Address Book Info In Palm Format


Eric Katchmar
04.21.2000
Rating: -3.60- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


Here is a Lotus script agent that will extract information from the name &
address book into a comma separated file with quotes around the data
(appropriate for importing into a palm pilot). It consists of two subroutines
- initialize and format_output. In order to be used, it will need to be put
into the name & address database as a shared agent.

An alternative for the impatient is to make a local copy of the name & address
book (Don't copy the ACL.), and put the agent in yourself.

As it is currently written, the agent must be run from a view. When you run
it, it tells you what it is about to do and asks whether you would like to
continue or not. It uses a view called "Quick Phone List", which you can
change to any person view in the NAB.

Code

Sub Initialize

Dim FileNum As Integer
Dim FileName As String
Dim oneLine As String
Dim session As New Notessession
Dim ws As New NotesUIWorkspace
Dim db As NotesDatabase
Dim view As NotesView
Dim doc As NotesDocument

' Set the output file number and name
FileNum = Freefile()
FileName = "C:Tempphone.csv"

Dim boxType As Long, answer As Integer
boxType& = MB_YESNO + MB_ICONQUESTION
answer% = Messagebox("This will export from the Name & Address book to the
file: " + FileName + ". Do you want to continue?", 0 + 33, _
"Continue?")

If answer% = 2 Then
Messagebox "Palm Pilot Export agent has been cancelled at your
request ", 0 + 16, "Agent Cancelled"
Exit Sub
End If

Set db = session.CurrentDatabase
Set view = db.GetView("Quick Phone List")
Set doc = view.GetFirstDocument

Open FileName For Output As FileNum

While Not (doc Is Nothing)
Call Format_Output(doc, oneline)
Print #FileNum, oneline
Set doc = view.GetNextDocument(doc)
Wend
Close FileNum
Messagebox "Export to " + FileName + " is complete.", 64, "Palm Pilot
Export Agent Success"

End Sub

Sub Format_Output (doc As notesdocument, oneline As String)

' NOTE: The "record layout" for the Palm device is as follows:
' Last, First, Title, Company, WorkPhone, HomePhone, Fax, Other, email,
Address, city, state, xip, country, custom1, custom2, custom3, custom4, note,
private, category
' The corresponding fields from notes are:
' LastName, FirstName, JobTitle, CompanyName, OfficePhoneNumber,
PhoneNumber, OfficeFaxPhoneNumber, Cellular, DisplayMailAddress, Location
' I have inserted place holders for city, state, zip, and country so the
custom 1 - 4 fields will line up properly as project, projectlocation,
projphone,projfaxphone.
' I also added placeholders for the last two fields, Private, and Category.
' Note: certain fields have if statements to check for data - it is vital
that something gets written out as a placeholder, whether there is data or not,
so all the fields line up correctly.
' The output string is built as we go along in case there is any trouble
with a particular field, it will be obvious which one it is.
Dim Q, C As String
Dim xx, yy As Variant
Q = """"
C = ","

' Last Name
xx = doc.LastName
oneline = Q + xx(0) + Q + C + Q

' First Name
xx = doc.FirstName
oneline = oneline + xx(0) + Q + C + Q

' Job Title
xx = doc.JobTitle
oneline = oneline + xx(0) + Q + C + Q

' Company
xx = doc.CompanyName
oneline = oneline + xx(0) + Q + C + Q

' Work Phone
xx= doc.OfficePhoneNumber
oneline = oneline + xx(0) + Q + C + Q

' Home Phone
xx= doc.homephonenumber
oneline = oneline + xx(0) + Q + C + Q

' Fax
xx= doc.OfficeFaxPhoneNumber
oneline = oneline + xx(0) + Q + C + Q

' Other
' Note - since there could be mutliple values here, I built the field
sepparately before appending it to the output line
xx= doc.Cellular
yy = doc.Pager
Other = ""
If xx(0) > "" Then
Other = "Cell: " + xx(0)
End If

If yy(0) > "" Then
Other = Other + " Pager: " + yy(0)
End If

If Other > "" Then
oneline = oneline + Other + Q + C + Q
Else
oneline = oneline + Q + C + Q
End If


' Email
yy=doc.FirstName
zz=doc.LastName
oneline = oneline + yy(0) + "." + zz(0) + "@iiginc.com" +

Rate this Tip
To rate tips, you must be a member of SearchDomino.com.
Register now to start rating these tips. Log in if you are already a member.




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Address Book
Formula language button manages Deny Access list searches
Find a Lotus Notes user within NAB Deny Access groups
Synchronize LinkedIn contacts with Lotus Notes Domino
How to correct Lotus Notes public key mismatches in four easy steps
Creating a Lotus Notes Personal Address Book replica
Admin user unable to create NAB
@Transform formula for use in R6
Change NAB while maintaining integrity of documents
NAB: A key piece of the Domino administration puzzle
Build an extended directory catalog

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Domino & Lotus Notes Security Solutions: Authentication, Antispam, Encryption and Antivirus
HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts