TCamisa
unread,Jan 6, 2012, 12:28:16 AM1/6/12You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
I just started playing with WIN32:OLE to automate some Lotus Notes
clean up. I started with the nice code provided by hvanbelle. This
is as far as I got:
use Win32::OLE;
my $server = 'SOMESERVER';
my $database = 'Mail\SOMEFILE.nsf';
my $folder = 'SOMEFOLDER\Reporting';
#connect to the Notes database
my $Notes = Win32::OLE->new('Notes.NotesSession') || warn "Cannot
start Lotus Notes Session object: $!\n";
my $Database = $Notes->GetDatabase($server, $database);
#Fetch contents of the folder
my $Response = $Database->GetView($folder);
my $Count = $Response->TopLevelEntryCount;
my $Index = $Count;
open (OUT, ">$file");
#loop through all emails
for (1..$Count)
{
my $Document = $Response->GetNthDocument($Index--);
my $subject = $Document->GetFirstItem('Subject')->{Text};
my $body = $Document->GetFirstItem('Body')->{Text};
my $date = $Document->GetFirstItem('Delivereddate')->{Text};
my $array_ref = $Document->{'$FILE'};
foreach my $attachment (@$array_ref)
{
if ($attachment)
{
print $attachment . "\t";
#I Think getting the attachment size is pretty important
# I tried a few things
like this:
my $objAttach =
$Document->GetAttachment($attachment);
print $objAttach->{FileSize};
print "\n";
#It Doesn't work
}
}
}
Any Suggestions for getting the file size of a attachment