Instead of getting the values using the . notation, I would use the getitemvalue method. (kept me away of nasty issues when there are field names the same as a property of the notesdocument objects.
Also, there are cases in which there are lots of documents, in that case there may be helpful to store a temporary value of the key field value (in this case, there would be less requests to field values from document)
I'm into performance every time I write code...
Instead of getting the values using the . notation, I would use the getitemvalue method. (kept me away of nasty issues when there are field names the same as a property of the notesdocument objects.
Also, there are cases in which there are lots of documents, in that case there may be helpful to store a temporary value of the key field value (in this case, there would be less requests to field values from document)
something like
dim vTmp as Variant
While Not(doc Is Nothing)
vTmp = doc.getitemvalue("GroupUNID")(0)
If Not IsElement(Groups(vTmp)) Then
Groups(vTmp) = doc.getitemvalue("GroupName")(0)
End if
Set doc = collection.GetNextDocument(doc)
Wend