WIN32::OLE and Lotus Notes

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
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')->;
    my $body = $Document->GetFirstItem('Body')->;
    my $date = $Document->GetFirstItem('Delivereddate')->;
    my $array_ref = $Document->;
    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 =
            print $objAttach->;
            print "\n";
            #It Doesn't work

Any Suggestions for getting the file size of a attachment

Re: WIN32::OLE and Lotus Notes

Em sexta-feira, 6 de janeiro de 2012 03h28min16s UTC-2, TonyShirt  escreveu:
Quoted text here. Click to load it

I have never created a Lotus Notes object, but like any object in perl... just
dump it and you will eventually discover, sooner if you grep responsibly. ;)

Site Timeline