how to export your crap from Lotus Notes

This is a discussion on how to export your crap from Lotus Notes within the PHP Language forums, part of the PHP Programming Forums category; Sub Initialize Dim arrAttachmentNames As Variant Dim session As New NotesSession Dim db As NotesDatabase Dim dc As NotesDocumentCollection Dim ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-08-2005
gumshoo3@yahoo.com
 
Posts: n/a
Default how to export your crap from Lotus Notes

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) )

fileName=CurrIDStr+"-"+arrAttachmentNames(n)
Print #1,""+fileName+""

Call
attachment.ExtractFile("d:/export/attachments/"+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
Wend

End Sub

Reply With Quote
  #2 (permalink)  
Old 02-08-2005
Erwin Moller
 
Posts: n/a
Default Re: how to export your crap from Lotus Notes

Are you sure you posted in the right group?

Regards,
Erwin Moller
Reply With Quote
  #3 (permalink)  
Old 02-08-2005
gumshoo3@yahoo.com
 
Posts: n/a
Default Re: how to export your crap from Lotus Notes

absolutely

Reply With Quote
  #4 (permalink)  
Old 02-08-2005
Andy Hassall
 
Posts: n/a
Default Re: how to export your crap from Lotus Notes

On 8 Feb 2005 09:05:07 -0800, gumshoo3@yahoo.com wrote:

> Dim session As New NotesSession


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.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Reply With Quote
  #5 (permalink)  
Old 02-09-2005
gumshoo3@yahoo.com
 
Posts: n/a
Default 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 ;-)

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 10:31 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0