Agent to send out attachment

I am trying to create and agent that will send out an attachment when it goes. Does anyone have any code examples of how to do this? I created a form and view in the database that holds the attachment I want to send. I deally I would like to send the email and have it grab the attachment. Is this possible?

Thanks

Subject: Agent to send out attachment

You could get a handle to the document containing your attachment and then generate your new email message, attach your file, and then send the email.

You could either copy over the field containing the attachment into the Body field on the email or you could get a handle to the embedded object of your attachment.

Lookup “embedded objects” in the help for some examples like below:

Sub Initialize

Dim db As NotesDatabase

Dim view As NotesView

Dim doc As NotesDocument

Set db = New NotesDatabase( “SanFrancisco”, “hill.nsf” )

Set view = db.GetView( “All Documents” )

Set doc = view.GetLastDocument

If doc.HasEmbedded Then

Forall o In doc.EmbeddedObjects

  Messagebox( o.Name )

End Forall

Else

Messagebox "No embedded objects found"

End If

End Sub

Subject: RE: Agent to send out attachment

Thanks for the suggestion I will give it a try.