Link to home
Start Free TrialLog in
Avatar of KTTKTT
KTTKTTFlag for United States of America

asked on

LotusScript Array used to capture entire contents of multivalue field - only getting first entry of multiple values

Trying to get the entire contents of the shortname field in the address book - only getting first entry in list.
Please assist.

Function FEmail (docx As NotesDocument) As String
With docx
Dim itemArray As Variant
Dim itemList List
Dim m As Integer

Dim NumFAlias As String 'Declare NumFAlias as type string

itemArray = docx.shortname


For m = 0 To Ubound (itemArray) ' Ubound is a function that returns a number of the highest index in the array itemArray - remember array start with a zero (0) index (if Ubound returns 7 there ' are 8 members in the array)

NumFAlias = itemArray(m) ' Use the value of shortname field
FEmail = Lcase$(NumFAlias & IDOMINIO)
Next m
End With
End Function

ASKER CERTIFIED SOLUTION
Avatar of cezarF
cezarF
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Sjef Bosman
Sjef Bosman
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of KTTKTT

ASKER

cezarF:  used your solution - it worked but now i have to get rid of the commas. How do I do a trim with this solution to remove commas?

sjef_bosman: thanks for this example as well.

Bill-Hanson: I appreciate the thorough explanation on how the code was looping - that explained the problem.   Just simply grabbing the shortnames to export to .xls.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@Kitkit: I Agree sjef and Bill-Hanson. It would have been easier if you used Join.  To answer your question, just change the ", " with " " or any delimiter you want.