how to export your crap from Lotus Notes

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Sub Initialize

     Dim arrAttachmentNames As Variant

     Dim session As New NotesSession
     Dim db As NotesDatabase
     Dim dc As NotesDocumentCollection
     Dim doc As NotesDocument
     Dim attachment As NotesEmbeddedObject
     Set db = session.CurrentDatabase
     Set dc = db.AllDocuments
     Set doc = dc.GetFirstDocument

     CurrID = 100000
     While Not doc Is Nothing

          CurrIDStr = CurrID

          Open "d:/export/records/"+CurrIDStr+".xml" For Output As 1
          Print #1, ""
          Print #1, ""+CurrIDStr+""

          arrAttachmentNames = Evaluate("@AttachmentNames", doc)
          For n = 0 To Ubound( arrAttachmentNames )

               If arrAttachmentNames(n) Like "*.*" Then

                    Set attachment = doc.GetAttachment(
arrAttachmentNames(n) )

                    Print #1,""+fileName+""

               End If
          Next n

          allFieldNames = Evaluate("@DocFields", doc)
          For k = 0 To Ubound( allFieldNames )

               Print #1, ""
               Print #1, ""
               Print #1, allFieldNames(k)
               Print #1, ""
               Print #1, ""

               If Not Isempty(doc.GetItemValue(allFieldNames(k))) Then
                    something = doc.GetItemValue(allFieldNames(k))(0)
                    Print #1, something
               End If

               Print #1, ""
               Print #1, ""

          Next k

          Print #1, ""
          Close #1

          Set doc = dc.GetNextDocument( doc )
          CurrID = CurrID + 1
End Sub

Re: how to export your crap from Lotus Notes

On 8 Feb 2005 09:05:07 -0800, wrote:

Quoted text here. Click to load it

 Ah, Notes, the black hole for data. Similar code using the same COM interface
works OK from Perl, using Win32::OLE, and making it somewhat more useful than
Visual Basic.

 Bit of a shame the PHP Lotus Notes functions ( ) are
pretty much dead.

< Space: disk usage analysis tool

Re: how to export your crap from Lotus Notes

That's the init method for a LotusScript Agent ;-)

That's where you dump the code to get your database out.  Thought I'd
place in the google code repository for future generations to find to
do this task without having to make a career out of it.  And in the PHP
group is where they'd find it.

Then put the data in one of those PHP CMS/groupware thingys.  In the
underlying database rather.  Databases are good at backups and
replication and export,  storing data, and stuff like that ;-)

Site Timeline