2007-10-25

Notes: View Entry's ColumnValues returns an array for a specific column

This will happen if the column's property "Show multiple values as selected entries" is selected.

In this case the ColumnValues property of the NotesViewEntry class, will return an Array and the common way of obtaining it's value will fail.

To access the entry's column value weather it's an array or not, use this:


Function getColValue (vCol As Variant) As String
If Isarray(vCol) Then
getColValue = Cstr(vCol(0))
Else
getColValue = Cstr(vCol)
End If
End Function

And then use it like this:

stringValue = getColValue(vwEntry.ColumnValues(1))

4 comments:

  1. Anonymous16:12

    Thank you for sharing it. I have a problem with that and you really help me with this post.

    ReplyDelete
  2. I'm glad it was helpful :)

    ReplyDelete
  3. Thank you very much for the tip. It really saved me the day

    ReplyDelete
    Replies
    1. You're welcome. :) I'm no longer a programmer, that's why I haven't updated this blog in ages, but I keep it online in hope it can be helpful to someone. Feels good to know it still is. :)

      Delete