File Save

Hi, I have written an agent that goes out to a document and pulls back specific data from it and then mails it to my inbox, all works very well, all the data that is picked up, is saved and format with the following call

Call qrtitem.AppendText( qitem.text )

Call qrtitem.AddNewLine( 1 )

Is it possible to take a data from qitem.text and automatically save it to my local machine, if so would anybody have some code examples, thanks

Subject: File Save

If the agent runs on your workstation, it should not be a problem to write data to a file. See the NotesStream method, or read about the “Open” statement (the help document contains links to other information that you need).

Subject: File Save

You could create a file allowing access to it for reading a file.

’ In this example, LotusScript reads the contents of a

’ comma-delimited ASCII file (c:\123w\work\thenames.txt)

’ into an array of RecType. RecType is a user-defined

’ data type.

’ c:\123w\work\thenames.txt consists of the following:

’ “Maria Jones”, 12345

’ “Roman Minsky”, 23456

’ “Joe Smith”, 34567

’ “Sal Piccio”, 91234

Type RecType

empId As Double

employee As String

End Type

Dim arrayOfRecs() As RecType

’ A dynamic array that will get sized to

’ the number of lines in c:\123w\work\thenames.txt

Dim txt As String

Dim fileNum As Integer

Dim counter As Integer

Dim countRec As Integer

’ Get an unused file number so LotusScript can open a file.

fileNum% = FreeFile()

counter% = 0

Open “c:\123w\work\thenames.txt” For Input As fileNum%

Do While Not EOF(fileNum%)

’ Read each line of the file.

Line Input #fileNum%, txt$

’ Increment the line count.

counter% = counter% + 1

Loop

’ Return the file pointer to the beginning of the file.

Seek fileNum%, 1

’ The file has counter number of lines in it, so

’ arrayOfRecs() is defined with that number of elements.

ReDim arrayOfRecs(1 To counter%)

’ Read the contents of the file into arrayOfRecs.

For countRec% = 1 To counter%

Input #fileNum%, arrayOfRecs(countRec%).employee$, _

  arrayOfRecs(countRec%).empId#

Next

Close fileNum%

Print arrayOfRecs(2).employee$ & " " arrayOfRecs(2).empId#

’ Output:

’ Roman Minsky 23456

Mike