Search code examples
lotus-noteslotus-dominolotusscriptlotus

how to get list of Lotus notes mail file's owners name


I wonder if it is possible to generate a list of email users and their owners to a text file? I'm a beginner in Lotus script ... can there be any database in domino administrator where can i find such data? Screen


Solution

  • Code example:

    Dim sess as new Notessession
    Dim dbdir as NotesDBDirectory
    Dim db as NotesDatabase
    Dim Profile As NotesDocument
    
    Set dbdir = New NotesDBDirectory("Servername")
    Set db = dbdir.GetFirstDatabase(1247)
    Do until db is nothing
        'expecting the mail files are located in subfolder mail, check the path
        If Ucase(Left(db.FilePath , 5)) = "MAIL\" Then
             If not db.IsOpen Then
                 Call db.Open("","")
             End If
             Set Profile = db.GetProfileDocument("CalendarProfile")
             Print Profile.Owner(0) ' prints out the owner name to Client Status bar or Server console
        End If
        Set db = dbdir.GetNextDatabase
    Loop
    

    The line

    Print Profile.Owner(0) ' prints out the owner name to Client 
    

    must be modified to match your needs. You can use the Lotus script write Statement.

    Take a look at IBM help Center:

    https://www.ibm.com/support/knowledgecenter/en/SSVRGU_9.0.1/basic/H_NOTESDBDIRECTORY_CLASS.html https://www.ibm.com/support/knowledgecenter/en/SSVRGU_9.0.1/basic/H_NOTESDATABASE_CLASS.html https://www.ibm.com/support/knowledgecenter/de/SSVRGU_9.0.0/com.ibm.designer.domino.main.doc/LSAZ_WRITE_LB_STATEMENT.html

    HTH, Markus