We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Get Folder Names From Lotus Domino by C#

Medium Priority
2,289 Views
Last Modified: 2013-12-18
I want to get all Folder Names from a NSF by C#. I am using the following code to get connect Notes from C#. Till now it is OK, but failed to collect all folder names from the C#.
Please Help
Domino.NotesSession ns=new Domino.NotesSession();
            ns.Initialize(tbPwd.Text);
            Domino.NotesDbDirectory ndd=ns.GetDbDirectory("DCOKOLS01");
            Domino.NotesDatabase ndb=ns.GetDatabase("DCOKOLS01","mail/Soumen Roy.nsf",false);
            Domino.NotesView nv = ndb.GetView("($All)");

Open in new window

Comment
Watch Question

To reinterpret your question, your views are not coming up.

if yes, check out "Code snippet for iterating through the views and fetching data" in below link:
http://www.codeproject.com/KB/cs/lotusnoteintegrator.aspx

hope it helps.

James

Author

Commented:

lucky_james:,

Thanx for your comment.

No, not the views, I want the folders. I have also visited your link, but the following line

NotesViewEntryCollection  notesViewCollection =LotusNotesView.AllEntries;

is not working , as attaching dll do not accept something like "LotusNotesView". That is not working. Also I am trying to get the folders, not views.

Thanx
Groupware Consultant
CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
sjef_bosman:

thanx for your code. but

Domino.NotesView allviews[] = ndb.Views;

line not working

thanx
Sjef BosmanGroupware Consultant
CERTIFIED EXPERT

Commented:
Shoot... I don't know, I don't speak C#   :-P

And "line not working", is that the error message you get from the compiler??

It could be one of the following (see code), depending on how the property is really named in C#. In LotusScript it is just Views, see:

http://www-12.lotus.com/ldd/doc/lotusscript/lotusscript.nsf/1efb1287fc7c27388525642e0074f2b6/05492a44c227e11f8525642e007702d7?OpenDocument

And a similar question:
http://stackoverflow.com/questions/1410893/how-to-access-contents-of-folders-created-by-user-in-lotus-notes-using-net
Domino.NotesView *allviews = ndb.Views;
Domino.NotesView *allviews = ndb.getViews();

Open in new window

Author

Commented:
Thanx sjef_bosman:,

I just used the following lines

            Domino.NotesView nv = ndb.GetView(csAllDocumentsViewName);
            object[] vws = ndb.Views as object[];

It works, thanx a lot

Author

Commented:
Thanx
Sjef BosmanGroupware Consultant
CERTIFIED EXPERT

Commented:
I could never have guessed that code. Thanks for reporting back!
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.