I don’t understand, why if a tag already exists on myList why it is not appending values to that tag. Each one of my tags only has 1 value. Any clues?
Sub Initialize
Dim session As New NotesSession
Dim curDb As NotesDatabase
Dim curView As NotesView
Dim curDoc As NotesDocument
Dim myList List As Variant
Dim newValue As String
Dim newTag As String
Dim reportView As NotesView
Dim reportDoc As NotesDocument
Dim reportDc As NotesDocumentCollection
Set curDb = session.CurrentDatabase
Set curView = curDb.GetView( “All” )
Set curDoc = curView.GetFirstDocument
Set reportView = session.CurrentDatabase.GetView( “Lookup” )
Set reportDoc = reportView.GetFirstDocument
While Not curDoc Is Nothing
keys = curDoc.UNID
Set reportDc = reportView.GetAllDocumentsByKey( keys , True )
If reportDC.count = 0 Then
If curDoc.SType(0) = “Corporation” Then
newTag$ =curDoc.Owner(0)
newValue$ =curDoc.Corp(0)
Else
If curDoc.SType(0) = “Association” Then
newTag$ =curDoc.Owner(0)
newValue$ =curDoc.Assoc(0)
End If
End If
myList(newTag$) = newValue$
End If
Set curDoc = curView.GetNextDocument( curDoc )
Wend
Forall elements In myList
myTag = Listtag(elements)
'Print "Element with tag " & myTag & " is " & elements
End Forall
End Sub