How can I use Perl to open my inbox through the Lotus Notes API?

I can open Lotus Notes api using Perl, without errors, I can also get a list of views, which includes Inbox, but when I try to read messages from this view, does it seem empty? What can i do wrong? (it actually seems that something has changed on the side of notes since this code was used before)

The result of the code is below: NAME of View: ($ Inbox) has an account: 0, etc.

CODE:

use Win32::OLE; my $Notes = Win32::OLE->new('Notes.NotesSession') or die "Cannot start Lotus Notes Session object.\n"; my $database = $Notes->GetDatabase("",'mail\VIMM.nsf'); $database->OpenMail; my $array_ref = $database->{Views}; foreach my $view (@$array_ref) { my $name = $view->{Name}; print "NAME of View is: $name "; $view = $database->GetView($name); print "has count of: ", $view->{entryCount}, "\n"; } 
+4
source share
4 answers

Is the mailbox open to all users? You can try to install -Default-access for the manager and provide all available roles, just to make sure that this is not a security problem that prevents viewing documents.

+1
source

I believe it says "EntryCount"?

In addition, I recommend "use strict" and "use warnings."

+1
source

Regarding the runrig comment, EntryCount is an attribute, so I believe you need: $ View → {entryCount}

+1
source

Try checking the Win32 :: OLE :: LastError () messages. You can do this explicitly with sub like:

 sub w32_ok { if (my $error = Win32::OLE::LastError()) { print "Win32::OLE Error! Got: $error"; } } 

Or if you encounter errors, for example:

 Win32::OLE->Option( Warn => 3 ); # will now croak on errors. 

You may have problems accessing the required data.

+1
source

All Articles