This code allows you to export information from a view into a text file. You can specify the delimiter to use in the call to Export.
Dim Session As New NotesSession
Dim CurDB As NotesDatabase
Dim View As NotesView
Dim Doc As NotesDocument
Dim FileNum As Integer
FileNum = Freefile
Open "C:\Export.txt" For Output As FileNum
Set CurDB = Session.CurrentDatabase
Set View = CurDB.GetView("Main")
Set Doc = View.GetFirstDocument
While Not(Doc Is Nothing)
Call Export(FileNum, Doc, ",")
Set Doc = View.GetNextDocument(Doc)
Sub Export(FileNum As Integer, CurDoc As NotesDocument, Sep As String)
Dim Values As Variant
Dim Cnt As Integer
Dim ExpStr As String
Values = Doc.ColumnValues
ExpStr = Values(0)
For Cnt = 1 To Ubound(Values)
ExpStr = ExpStr & Sep & Values(Cnt)
Print #FileNum, ExpStr
By submitting your personal information, you agree that TechTarget and its partners may contact you regarding relevant content, products and special offers.
MEMBER FEEDBACK TO THIS TIP
In the export, Subroutine doc. should be replaced by CurDoc. to make it work.!
Do you have comments of your own? Let us know.