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

[亡魂溺海] 提交于 2019-11-30 20:27:54

问题


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.


回答1:


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



回答2:


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).



来源:https://stackoverflow.com/questions/1238276/reading-lotus-notes-domino-mailbox-using-interop-domino-dll

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!