mhi has asked for the wisdom of the Perl Monks concerning the following question:
I'm looking at accessing my Lotus Notes Datebook through perl and would like to know how I can visualize the document structure of an appointment (i.e. show all its attributes and their respective values).
Is there a ready-made function to do this
The (fully functional) code I'm currently using is the following, which finds a number of appointments in my calendar and prints their titles:
I'm just hoping I don't have to write code to individually check every one of the attributes in these tables the same way as with the subject attribute above. (Not to mention possible multivalue and/or structured attributes... do they use those in Notes?)#!/usr/bin/perl -w use strict; use Notes::OLE; use vars qw( $SERVER ); $SERVER=''; # leave empty if querying local client my $mailfile='mail\myshortname.nsf'; my $maxdocs=50; # 0=all my $maxshowdocs=5; my $db = $S->GetDatabase($SERVER, $mailfile); my $docs=$db->Search( "Form = \"Appointment\"" , $DT, $maxdocs); # "Ap +pointment"(calendar) or "Memo"(email) my $count = $docs->Count; print "found ",$count," docs.\n\n"; # show the appointments' titles for(my $i=1; $i<=$maxshowdocs and $i<=$count ;++$i){ my $doc=$docs->GetNthDocument($i); if($doc->HasItem('Subject')){ print $doc->GetFirstItem('Subject')->{Text},"\n"; }else{ print "No Subject\n"; } }
Thanks for any suggestions!
Michael
Update: added clarification on "mailbox documents" and on first sentence.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Notes::OLE: Doc-Dumper?
by diotalevi (Canon) on Jul 06, 2004 at 13:50 UTC | |
|
Re: Notes::OLE: Doc-Dumper?
by Zero_Flop (Pilgrim) on Jul 06, 2004 at 19:15 UTC | |
|
Re: Notes::OLE: Doc-Dumper?
by mhi (Friar) on Jul 07, 2004 at 12:30 UTC | |
by Zero_Flop (Pilgrim) on Jul 08, 2004 at 00:53 UTC | |
by mhi (Friar) on Jul 08, 2004 at 08:14 UTC |