hello,i need some help in order to create dynamically a text file from an agent. This text file will include values from fields that are in the form by which the agent will be called.
Here is what i have done till now but i always get the message : " Unable to open file"
Sub Initialize
On Error Goto ProcessError
Dim db As NotesDatabase
Dim dbAgent As NotesDatabase
Dim dc As NotesDocumentCollection
Dim doc As NotesDocument
Dim subj As Variant
Dim curDoc As NotesDocument
Set session = New NotesSession
Set db = session.CurrentDatabase
Set dbAgent = New NotesDatabase("", "webagent.nsf")
Set dc = db.UnprocessedDocuments
Set doc = dc.GetFirstDocument
Set curDoc = session.DocumentContext
subj1 = doc.GetItemValue( "Assurance_surname" )
subj2=curDoc.Assurance_surname
Dim fileNum As Integer, text As String
fileNum% = Freefile()
Dim pathname as String
pathname=d:\ioanna\File.txt"
Open pathname For Append Access Write As fileNum%
Print #fileNum%, subj1
Print #fileNum%, subj2
Close fileNum%
End Sub