Hi
In my mail-in database, I am trying to read and process the name of an attachment(if any) in a ‘before new mail arrives’ agent.
Using the code below, a ‘type mismatch’ is returned on the forall statement. I have read similar problems on this forum earlier, but no one seem to have a solution. It should work, as the code is copied from the help file. Any ideas?
Sub Initialize
Dim session As New notessession
Dim currentdb As notesdatabase
Dim doc As NotesDocument
Set currentdb = session.CurrentDatabase
Set doc = session.DocumentContext
If doc.HasEmbedded Then
Forall o In doc.EmbeddedObjects '<-This returnes 'Type mismatch'. Why?
Messagebox( o.Name )
End Forall
Else
Messagebox "No embedded objects found"
End If
End Sub