#!/usr/bin/perl -w use strict; use Notes::OLE; use vars qw( $SERVER ); $SERVER=''; # empty when querying local client my $mailfile='mail\myshortname.nsf'; my $maxdocs=50; # 0=all my $maxshowdocs=1; my $n="\n"; 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"; for(my $i=1;$i<=$maxshowdocs and $i<=$count ;++$i){ print "############## Document $i ###################\n\n"; my $doc=$docs->GetNthDocument($i); my $items=$doc->Items; foreach my $item (@$items){ my $name=$item->Name; my $type=$item->Type; print "ItemName: $name / ItemType: $type"; my $val; if( $type==1024 ){ # Type-Value for DateTime Type my $dtarr=$doc->GetItemValueDateTimeArray($name); print " [", scalar @$dtarr," value(s) in Item]"; print " (DateTime) "; foreach my $dtelem (@$dtarr){ if( $name=~/Range$/ ){ # DateTime or NotesDateRange? ***** $val .= ($dtelem->{StartDateTime}->{LocalTime})." - ". ($dtelem->{EndDateTime}->{LocalTime})." "; }else{ $val .= ($dtelem->{LocalTime})." "; } } }else{ $val=$doc->GetItemValue($name); print " [", scalar @$val," value(s) in Item]"; $val=join($n, @$val); } print "$n$val$n$n"; } }