how to export your crap from Lotus Notes

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • gumshoo3@yahoo.com

    how to export your crap from Lotus Notes

    Sub Initialize

    Dim arrAttachmentNa mes As Variant

    Dim session As New NotesSession
    Dim db As NotesDatabase
    Dim dc As NotesDocumentCo llection
    Dim doc As NotesDocument
    Dim attachment As NotesEmbeddedOb ject
    Set db = session.Current Database
    Set dc = db.AllDocuments
    Set doc = dc.GetFirstDocu ment

    CurrID = 100000
    While Not doc Is Nothing

    CurrIDStr = CurrID

    Open "d:/export/records/"+CurrIDStr+".x ml" For Output As 1
    Print #1, ""
    Print #1, ""+CurrIDSt r+""

    arrAttachmentNa mes = Evaluate("@Atta chmentNames", doc)
    For n = 0 To Ubound( arrAttachmentNa mes )

    If arrAttachmentNa mes(n) Like "*.*" Then

    Set attachment = doc.GetAttachme nt(
    arrAttachmentNa mes(n) )

    fileName=CurrID Str+"-"+arrAttachment Names(n)
    Print #1,""+fileName+ ""

    Call
    attachment.Extr actFile("d:/export/attachments/"+fileName)
    End If
    Next n

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

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

    If Not Isempty(doc.Get ItemValue(allFi eldNames(k))) Then
    something = doc.GetItemValu e(allFieldNames (k))(0)
    Print #1, something
    End If

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

    Next k

    Print #1, ""
    Close #1

    Set doc = dc.GetNextDocum ent( doc )
    CurrID = CurrID + 1
    Wend

    End Sub

  • Erwin Moller

    #2
    Re: how to export your crap from Lotus Notes

    Are you sure you posted in the right group?

    Regards,
    Erwin Moller

    Comment

    • gumshoo3@yahoo.com

      #3
      Re: how to export your crap from Lotus Notes

      absolutely

      Comment

      • Andy Hassall

        #4
        Re: how to export your crap from Lotus Notes

        On 8 Feb 2005 09:05:07 -0800, gumshoo3@yahoo. com wrote:
        [color=blue]
        > Dim session As New NotesSession[/color]

        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 (http://uk2.php.net/notes) are
        pretty much dead.

        --
        Andy Hassall / <andy@andyh.co. uk> / <http://www.andyh.co.uk >
        <http://www.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool

        Comment

        • gumshoo3@yahoo.com

          #5
          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 ;-)

          Comment

          Working...