views:

1070

answers:

3

I would like to populate the list of mailboxes from "Mail" folder of Domino from c# using the above API (Interop.Domino.dll). I have no problems connecting to Notes, accessing the database.It is easy to access all nsf files but i want to access only only nsf files in Mail Folder i.e Mail files.

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  A: 

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
Ken Pespisa
Thanx Ken.I got the solution.Now i can list all NSF files from "mail" folder.Now Next step is to list calenders,journals,contacts,in box ,sent e.t.c.
Preeti Singh
A: 

but database is not localdatabase what i can instead of _localDatabase please help thanks, Firoz

Firoz
A: 

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

Alexey Zimarev