Author Topic: Agent to write documents in a View to text file  (Read 1090 times)

0 Members and 1 Guest are viewing this topic.

Offline MrSpecialist

  • Sr. Member
  • *
  • Posts: 342
  • Karma: +1/-0
  • I'm an expert!
    • View Profile
Agent to write documents in a View to text file
« on: November 27, 2008, 02:03:28 AM »
Agent to write documents in a View to text file

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:

Code: [Select]
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:DataNotesRecertification.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.

Techronnati | where technology never sleeps

Agent to write documents in a View to text file
« on: November 27, 2008, 02:03:28 AM »

Mountain View

 

Related Topics

  Subject / Started by Replies Last post
1 Replies
154 Views
Last post November 04, 2008, 12:05:28 AM
by Transformer10
3 Replies
2863 Views
Last post August 17, 2016, 07:56:30 AM
by MrSpecialist
0 Replies
127 Views
Last post December 16, 2008, 07:49:13 AM
by rpmolecule
2 Replies
83 Views
Last post July 21, 2016, 02:13:02 AM
by Berto
1 Replies
84 Views
Last post July 21, 2016, 06:40:28 AM
by MrSpecialist

Posting Disclaimer: Any individual may post a message in this forum and may do so anonymously. Therefore, the sole author is exclusively and entirely responsible for all opinions in that message. They do not represent the official opinions of Techronnati, its administrators or moderators or the Techronnati Management. Techronnati is merely acting as an impartial conduit for constitutionally protected free speech and is not responsible and will not be held liable for the content of such messages. All images and service logos are trademarks of their respective owners.