WIN32::OLE and Lotus Notes
- From: TCamisa <tonyshirt@xxxxxxxxx>
- Date: Thu, 5 Jan 2012 21:28:16 -0800 (PST)
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
.
- Prev by Date: Re: IntervalTree
- Next by Date: LWP::UserAgent and proxies with NTLM handshake
- Previous by thread: Re: IntervalTree
- Next by thread: LWP::UserAgent and proxies with NTLM handshake
- Index(es):
Relevant Pages
|