Embedded View Agent Issue

I cannot seem to get the collection created with those items selected in an embedded view using UnprocessedDocuments. How can I build the collection from the embedded view. Just as a note, this is code from a Sandbox NSF called “changeselected”… stripped a bit from the original

Sub Initialize

Dim session As New notessession

Dim collection As NotesDocumentCollection

Dim db2 As notesdatabase

Dim currdoc As NotesDocument

Dim workspace As New NotesUIWorkspace

Dim item As Notesitem

Dim i As Long

Set db2 = session.CurrentDatabase

Set collection=db2.UnprocessedDocuments

For i = 1 To collection.Count