The preceding has a few minor bugs and overall, isn't terribly useful as programs go. See Notes::OLE - Lotus Domino via Win32::OLE for an actual Domino developer's take on Win32::OLE access to Lotus Domino. my $Database = $Notes->GetDatabase( ... ) or die ...This will never fail. If the database does not exist then the database will not be opened and the $Database->{'IsOpen'} property will be false. Test that instead. Someone else already noted that "mail\$userid.nsf" is incorrect and either "mail\\$userid.nsf" or better, $Database->OpenMail() should be used. $AllDocuments->GetNthDocument( ... )This is known to be a wastefully expensive way to access a Document in a DocumentCollection. Instead of getting documents by number, use an iterator:
my $doc = $AllDocuments->GetFirstDocument;
while ( $doc ) {
...
$doc = $AllDocuments->GetNextDocument( $doc );
}
|