Hi Aivis,
also ich habe es hinbekommen mit der Perl Version von ActiveState:
Ein Beispiel:
---begin---
#!/usr/bin/perl -w
use strict;
use Win32::OLE;
my %count;
my $Buffer;
my $choice;
my $doc;
my $Document;
my %noteshash = ();
my $num;
my $userid = "mail/meinemaildb.nsf";
my $search;
my $server = "myhomeserver.myfirm.de";
my $val;
my $VERSION = '1.0';
my $Notes = Win32::OLE->new('Notes.NotesSession')or die "Cannot start Lotus Notes Session object.\n";
my $Database = $Notes->GetDatabase($server, $userid) or die "Could not open database.\n";
my $AllDocuments = $Database->GetView('($Inbox)');
#my $Count = $AllDocuments->Count;
#my @counted = (1 .. $Count);
$doc = $AllDocuments->GetFirstDocument;
print "\n\nPlease wait while the notes mail file is processed . . .\n\n";
#foreach $doc (@counted) {
while ($doc) {
$val = $doc->GetItemValue('Subject');
print @$val[0]."\n";
$doc = $AllDocuments->GetNextDocument($doc);
# $val = sprintf "$doc. %s", $Document->GetFirstItem('Subject')->{Text};
# $noteshash{$doc}=$val;
}
while ($choice ne "Q"){
print "\n\nWelcome to the Perl Notes client.\n";
print "Press I to look at an index of email.\n";
print "Press B to look at the body of a message.\n";
print "Press Q to exit the program.\n";
chomp($choice = <STDIN>);
$choice =~ tr/a-z/A-Z/;
if ($choice eq "I") {
&idex;
}
if ($choice eq "B") {
&body;
}
if ($choice eq "Q") {
exit;
}
}
sub idex {
my $docnum;
print "What is the first number you would like to see? ";
chomp($docnum = <STDIN>);
my $limit = $docnum + 5;
for ($docnum; $docnum < $limit; $docnum++) {
$Document = $AllDocuments->GetNthDocument($docnum);
$val = $Document->GetItemValue('Subject');
print "Number: $docnum Subject: @$val[0]\n";
}
}
sub body {
print "What document would you like to look at? ";
chomp($doc = <STDIN>);
$Document = $AllDocuments->GetNthDocument($doc);
# my @Attributes = $Buffer->info();
print "\n\n$doc\n".$Document->GetFirstItem('Body')->{Text};
}
---end---
Ich habe zunächst CygWin installiert, danach Perl von ActiveState, beides verlinkt ... klappt. Allerdings musst Du einige der benötigten Module nachladen, aber nicht von CPAN :-( sondern direkt mit dem Modulemanager von ActiveState: ppm3
Gruss JoFa