简体   繁体   中英

Reading Lotus Notes & Domino Mailbox using Interop.Domino.dll

I would like to populate the list of mailboxes from "Mail" folder of Domino using C# and Interop.Domino.dll.

I can connect to the Notes database and access all nsf files, but how can I access only the nsf files in the Mail Folder?

I am using below code:

                while (_localDatabase != null)
                {

                    dbString = _localDatabase.Title;
                    TreeNode objRootNode = new TreeNode(dbString);
                    objForm.tvwExchDomain.Nodes.Add(objRootNode);
                     dbCount = dbCount + 1;
                    _localDatabase = dir.GetNextDatabase();
                   }

Kindly suggest me some links or sample code which will make my work simpler. I am using Domino Server 8.5.

To return only databases from within a specific folder, you'll have to do some filtering work yourself. I've done this a couple of ways. One method is to use the database's FilePath property, and then check to see if the path is underneath the mail folder. The other way is to check the database's template. That is a bit less work, provided all of your mail files are set to a particular database template, and no unwanted databases use that template.

First method:

If _localDatabase.IsOpen Then
    If Instr(1, "mail", _localDatabase.FilePath, 5) <> 0 Then
        'do work here
    End If
End If

Second method:

If _localDatabase.IsOpen Then
    If _localDatabase.DesignTemplateName = MAIL_TEMPLATE_NAME Then
        'do work here
    End If
End If

I would open the server NAB and look through all user documents in the ($Users) view. Each of these documents contain the mail file path (and server name).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM