?
Solved

Get Folder Names From Lotus Domino by C#

Posted on 2011-04-24
8
Medium Priority
?
2,015 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

0
Comment
Question by:Amitava_Mukherjee
  • 4
  • 3
8 Comments
 
LVL 7

Expert Comment

by:lucky_james
ID: 35458108
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
0
 

Author Comment

by:Amitava_Mukherjee
ID: 35458120

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
0
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 2000 total points
ID: 35458818
Views are Folders. Well, not exactly, but you can find the folders in the list of views.

What you need is something like the code below (not tested, and please verify every line).

I don't write C#, but this should give you the clues you need.
Domino.NotesSession ns= new Domino.NotesSession();
ns.Initialize(tbPwd.Text);
Domino.NotesDatabase ndb=ns.GetDatabase("DCOKOLS01","mail/Soumen Roy.nsf",false);
Domino.NotesView allviews[] = ndb.Views;
for(i= 0; ...; i++) {
	if(allviews[i].isFolder) {

		// your code

	}
}

Open in new window

0
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 

Author Comment

by:Amitava_Mukherjee
ID: 35459328
sjef_bosman:

thanx for your code. but

Domino.NotesView allviews[] = ndb.Views;

line not working

thanx
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 35464986
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

0
 

Author Comment

by:Amitava_Mukherjee
ID: 35466514
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
0
 

Author Closing Comment

by:Amitava_Mukherjee
ID: 35466528
Thanx
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 35466585
I could never have guessed that code. Thanks for reporting back!
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month15 days, 13 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question