Reading Lotus Documents from .NET (VB or C#)

I am a VB.NET developer. I need to build a VB.NET app that can open a Lotus Notes document and parse the data. I’ve googled and not been able to find anything relevant to documents. Here are my considerations:

  1. I’ve downloaded the Lotus Notes 8.5 trial suite and created a document which appears to be stored as ‘TestDocument.odt’ in MyDocuments which is fine.

  2. I’ve built the app using the COM Domino Objects reference dll.

  3. I can initialize a session.

  4. I’m lost here. I do not understand how to open the document and read whatever I can into VB.

  5. I do not understand the concept of the database as Lotus is using it. Are my documents supposed to be stored in one?

This is a proof of concept project but my final project will go up against a Domino server.

Can someone point me in the right direction. I don’t think I’m first guy trying this.

Many thanks!

Ron Thomas

Subject: second

In general, I second what Chris said. You’ve got to have a basic understanding of how data is stored and organized in Notes before you go further.

The odt file that you’ve created was probably created in the Lotus Symphony component that ships with Notes 8.5. This is a word processing document similar to a ‘.doc’ file created by MS Word. It is not, however, a Notes document in a Notes database. Notes databases have an ‘nsf’ extension and the documents are contained within the nsf file.

You’ve got a learning curve to climb, but it is well worth the effort. Good luck!

Subject: Bad news

Ron,

Sounds like you are at absolute square one with regards to Domino development.

Step 1: throw out what you know about database development.

Step 2: Read this http://www.redbooks.ibm.com/abstracts/sg246854.html chapters 1 - 7 & chapter 14. It’s for release 6 but the concepts should be the same.

Before you can develop using Lotus Notes/Domino you need to understand the basics about the design elements and how the data can be stored/accessed. Trust me on this, I started where you were about 5 years ago with a background in .Net and SQL Server 2000.

Good Luck

-CK

Subject: crystal reports

Or you could use the Lotus Notes SQL driver, through crystal or independently, and just try and not learn too much about notes.Depending on what kind of data you have you might also try dXL as well (thats Domino XML!) that can be quite quick.

If you are happy writing parsers you can even consider (if available) using the HTTP version of whatever data you’re looking at, and then stick HTTrack on the end of it, and parse you’re way through the structured output.

I have found that COM is buggy, and might work its way through 80% of a 600MB nsf and then die, which isn’t workable as an automated solution for me.

Subject: LotusScript COM: Open a NotesDocument in UI

I am working on coexistence between Microsoft Outlook and IBM Lotus Notes Domino. I am adding context menu’s where items in MS Outlook that originated from Lotus Notes should show a “Open Document” in the right click menu in Outlook. When that menu option is clicked it should open up the NotesDocument using the Document UNID stored in the Outlook Item. It errors out at the NotesUIWorkspace.EditDocument(doc) line. I don’t think I can use UIWorkspace through COM to open a notesdocument.

I tried returning to a NotesUIDocument, that errors out, I tried all combinations of input parameters to EditDocument(boolvalue, doc, boolvalue), nothing works. Is there any other way?

Let me know if anyone figures out how to open a NotesDocument in the User Interface of Lotus Notes or alternative solutions.

Public Sub OpenLNDatabase(servername As String, dbname As String, docID As String, docKey As String)

Dim ws As Object '(NotesUIWorkSpace)

Dim cLotusNotes As New clsLotusNotes

Dim LNDb As NotesDatabase

Dim LNdoc as NotesDocument

Dim LNSession as new NotesSession



If (servername = "" Or dbname = "") Then

    MsgBox "I am not configured to open this Lotus Notes database.  Please contact support", vbCritical, Title

    Exit Sub

End If



Set LNSession = New NotesSession

Call cLotusNotes.session.Initialize

                  

Set ws = CreateObject("Notes.NotesUIWorkspace")



Set LNDb = LNSession.GetDatabase(servername, dbname)

   

If (docID = "" And docKey = "") Then

'THIS WORKS

    Call ws.OpenDatabase(servername, dbname, "", "", "")

Else

    'open document in database by docuid

    If (docID <> "") Then

    Set LNDoc = LNDb.GetDocumentByUNID(docID) 'works

    Call ws.EDITDOCUMENT(LNDoc) 'automation error



   Else

        If (docKey <> "") Then

        'search a view for a field value

        'to get a handle to a notesdocument.

        End If

    End If

    

End If



Set ws = Nothing

End Sub