When you create an agent, there're settings for how the agent runs. Set them to "on a schedule", and "multiple times a day". There's a button there, too. click the button and there's a "server to run this agent". Put an asterisk in that field. It'll change to "any server" when you hit ok.
You can run it more often than every hour, but let's start there. It'll have a huge backlog of everything in your email. (we can change that if your email is already at the thousands).
The "Initialize" section is where you want to put your code.
Below is some boiler plate to get you scanning through "new mail". It'll start you off with some very standard things for scanning a collection. I'm hopeful, but I may've misspelled a thing or two, since I'm just typing this stuff in & not running it through Designer. But ... give it a whirl:
dim sess as New NotesSession
dim db as NotesDatabase
dim coll as NotesDocumentCollection
dim doc as NotesDocument
dim eo as NotesEmbeddedObject
set db = sess.CurrentDatabase
'collect all the documents changed since the last scheduled run
set coll = db.UnprocessedDocuments
set doc = coll.GetFirstDocument
while not doc is nothing
'[[your extraction code will go here]]
set doc = coll.GetNextDocument(doc)