Combine Collections

Is it possible to combine two different collections.

I have a master db I would like to display info from two other dbs. I would like to get a Collection from both dbs, combine them, sort, and then write the info out to an RTF with corresponding info and doc links.

I have searched but did not find anything that would point me in the right direction.

Subject: Combine Collections

Collections can only hold documents from a single database.

Subject: Combine Collections

Sort of, kind of. You can use a List to imitate a collection. Just define a unique identifier key for each document. Something like this:

Dim doclist List As NotesDocument

Dim dc1 as NotesDocumentCollection

Dim dc2 as NotesDocumentCollection

Dim dockey As String

'Get your two collections then:

Set doc = dc1.GetFirstDocument

Do While Not (doc Is Nothing)

dockey = doc.Whatever(0)

Set doclist( dockey ) = doc

Set doc = dc1.GetNextDocument(doc)

Loop

Set doc = dc2.GetFirstDocument

Do While Not (doc Is Nothing)

dockey = doc.Whatever(0)

Set doclist( dockey ) = doc

Set doc = dc2.GetNextDocument(doc)

Loop

You now have a List of documents. If you generate an array of your doc keys and sort them, you can the work through the List and do what you want with it.

Subject: RE: Combine Collections

I think I can handle that, but will I still be able to get get a doclink with the list?

Subject: RE: Combine Collections

Yes, because the members of the List are the actual NotesDocuments. You can generate links to them as easily as if you were accessing them from a Collection.

Subject: RE: Combine Collections

Finally had a chance to work on this, it worked great for me.

Thank you very much for helping me out, I really appreciate it.