I am unable to get any handle to a document via agent, the senario is that the agent has to act on the doc that is getting copied / mailed to the database and must eventually update the doc.
Subject: Unable to access the Doc context via Agent.
look at the designer help file at the NotesDatabase UnprocessedDocuments property or the NotesSession DocumentContext property (for web agents). This should get you started.