Hello there.
I’m working on an application that exports the columns from Lotus Notes to Excel. This is a summary on how my program works.
-
Employee documents are sorted according to the Hire Date, not creation date in a view.
-
A user ticks the needed document. The unprocesseddocument method is used.
-
Since the some of the fields that needs to be exported into excel is encrypted, the fields are empty inside the view. So to export the encrypted fields, selected document is opened one by one in edit mode before datas are extracted into the excel file.
-
Document is closed and the next document is opened.
So my current problem now is, the documents that are selected and opened are not being selected according to view in which it is sorted. The documents are selected by it’s creation date instead. I know there’s a class called NotesViewEntry that selects a document according to how it’s sorted in a view, but I can’t seem to use it as I need to use NotesDocumentCollection class to select the ticked document.
If I use only NotesViewEntry to select the wanted documents, I can’t get it to select only the ticked documents. And when I use NotesDocumentCollection only, the documents sequence is not the same as it’s original sequence inside the view.
So my question here, how do I get the NotesViewEntry class and NotesDocumentCollection class to work with each other?
Here’s a portion of the coding, it’s actually very long, but I took out the part where it exports the code to excel.
Sub Click(Source As Button)
Dim workspace As New NotesUIWorkspace
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument
Dim maxFiles As Integer, i As Integer
Dim scope As String
Dim rows As Integer, cols As Integer, maxcols As Integer
Dim excel As Variant
Dim excelSheet As Variant
Dim colvals As Variant
Dim K As Integer
Dim c As NotesViewColumn
Dim Filename As String
Dim x As Integer
Dim refNo As String
Dim item As Variant
Dim xlVarFileName As Variant
Dim xlFilename As String
Dim salary As String
Filename = Inputbox(" Enter filename :")
refNo = Inputbox("Enter Reference Number:")
Dim y As Variant
rows=2
cols =1
Set db = session.CurrentDatabase
Set view = db.GetView("Main Form")
Set collection = db.UnprocessedDocuments
Set doc = collection.GetFirstDocument
For x= 0 To collection.Count-1
Dim uidoc As NotesUIDocument
Set uidoc = workspace.EditDocument(True,doc)
Next x
End Sub
Thank you for your kind attention ![]()