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 ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |
|
|||
|
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 |
|
|||
|
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 ;-) |