×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

fill array with items

fill array with items

fill array with items

(OP)
I need to get all the items from a document into an array.  I have tried the following code with no luck.  (Type mismatch error).  Any clue what I'm doing wrong?  If I just put the Name & text into a messagebox, it shows what I want, but I can't get it into the array!  Thanks!  

leslie

Forall i In doc.Items
    all(i) = (i.Name + ":  " + i.Text)
End Forall    
    

RE: fill array with items

What is all() in your code?
You are using i as index for the ForAll cicle (where i is a variant of Notesitem) and the next line you're using the same variable as index for an array??
Do you know something I miss?
Try the code below:

Option Base 0
' so you're sure where arrays starts
Sub Toarray(doc As Notesdocument)
 Dim docitems As Variant
 Dim all() As String
 Dim icount As Integer, i As Integer
 ' Now we collect the items
 docitems=doc.Items
 ' Count items collected
 icount=Ubound(docitems)
 ' At this point we can create the array to receive values
 Redim all(count)
 ' retrievin values from items
 i=0
 Forall item In docitems
  all(i)=item.Name+": "+item.Text
  i=i+1
 End Forall
 ' here you got your values in all()
End Sub

Let me know if you found this useful

RE: fill array with items

(OP)
This thread is from May of 2002(!), I don't even remember what I was trying to accomplish, but I'm sure I figured something out!

Thanks

Leslie
landrews@metrocourt.state.nm.us

There are 10 types of people in the world -
those who understand binary
and
those who don't!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close