Creating an agent to compose a doc?

Hi all,I have an application written in louts, what i need to do is to write an agent to go through some of the docs in the database and extract some selective information and present them. I have designed a form to be used to present extracted data. This new form should consist of a table, number of columns and rows of the table will be determined by this agent so i am thinking of using “NotesRichTextTable” but when i try to do the following i get “object variable not set” error on marked line:

Dim Uworkspace As NotesUIWorkspace

Dim UDoc As NotesUIDocument

Dim rtitem As NotesRichTextItem

→ Set UDoc = Uworkspace.ComposeDocument (“”,“”,“theForm”)

the problem might be i am not allowed to access NotesUIWorkspace in an agent. but i don’t know howelse i can compose a doc using a form so that i can appendTable.

Any help would be greatly appreciated

Thanks in advace

Sorena

Subject: creating an agent to compose a doc ?

Dim Uworkspace As New NotesUIWorkspaceCall Uworkspace.ComposeDocument( “”, “”, “theForm” )