Hi I am trying to write documents in a view to a text file My small piece of code is shown below. Please bare in mind im new to LotusScript and theres probably a few holes you can see with it:
Sub Click(Source As Button)
On Error Resume Next
Dim session As NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Set session = New NotesSession
Set db = session.CurrentDatabase
Set view = db.GetView("People (other)\Certificate Expiration")
Set doc = view.GetFirstDocument()
strOut = "Begin Processing" &Chr(13) & Chr(10)
While Not (doc Is Nothing)
Error.clear
Set nextdoc = view.GetNextDocument(doc)
strUser = doc.GetItemValue(0)
strOut = strOut & "Processing " & strUser & Chr(13) & Chr(10)
If Err <> 0 Then
strOut = strOut & "--> ERROR: " & Error$ & Chr(13) & Chr(10)
End If
Set doc = nextdoc
Wend
intHandle = Freefile
Open "D:\Data\NotesRecertification.txt" For Output As #intHandle
Print #intHandle, strOut
Close #intHandle
Msgbox "Finished"
End Sub
The code creates the text file fine however all documents are replaced with the same error message “Type mismatch”
Can anyone see where ive went wrong
Thanks for the help.