#!/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); # "Appointment"(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"; } }