I have a script (found on the web and adjusted to my needs) that can access a specific view of Lotus Notes, pick up some info from each email and save any attachment to a given folder. If I want to do this for more views I currently have the names of these views in my worksheet and loop through them. What I would like to do is to loop through all views and do the same.
I am not a professional developer and not yet entirely familiar working with objects. This problem however is to complicated for me. The Lotus Notes object is also not the easiest to understand.
I am using the following code which of course is part of a larger (working) script. For starters it would be enough to just be able to loop through all views and print the Name of the view. From there on I think I can do the rest myself. Can anyone adjust the code to make it work.
Public Sub Get_Notes_Email_Text()
Dim NSession As Object 'NotesSession
Dim NMailDB As Object 'NotesDatabase
Dim NDocs As Object 'NotesDocumentCollection
Dim NDoc As Object 'NotesDocument
Dim NNextDoc As Object 'NotesDocument
Dim view As String
'Start a Lotus Notes session
Set NSession = CreateObject("Notes.NotesSession")
'Connect to the Lotus Notes database
Set NMailDB = NSession.GetDatabase("", "C:\Users\" & Environ("Username") & "\AppData\Local\IBM\Notes\Data\mail\" & Environ("Username") & ".nsf") 'Default server en database
If Not NMailDB.IsOpen Then
NMailDB.OpenMail
End If
'Loop through all views and print .Name tot Immediate Window
' Dim Map As Variant
' Dim Mappen As Object
' Set Mappen = NMailDB.Views
'
' For Each Map In Mappen
' Debug.Print Map.Name
' Next Map
'
End Sub