Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Lotus Notes documents by Date keys

by runrig (Abbot)
on May 23, 2007 at 22:58 UTC ( [id://617131]=CUFP: print w/replies, xml ) Need Help??

It took me a while to figure out how to get documents from Lotus Notes views with date keys, so here's a bit of code that may help someone else someday.

Update: the date range does not work for me. It seems to work for a span of a few days, if there are only documents from one particular day, but if there are documents from more than one day, it only returns one group of documents from one day. YMMV :-(

use strict; use warnings; use Win32::OLE; my $Notes = Win32::OLE->new('Notes.NotesSession') or die "Cannot start Lotus Notes Session object.\n"; my $Database = $Notes->GetDatabase('server', 'dbfile.nsf'); my $View = $Database->GetView("By Start Date"); # Date format is according to your regional setting my $start_date = "03/28/07"; my $StartDate = $Notes->CreateDateTime($start_date); #my $date_range = "03/01/07 - 03/31/07"; #my $DateRange = $Notes->CreateDateRange(); #$DateRange->{Text} = $date_range; # Use $StartDate or $DateRange here my $Entries = $View->GetAllEntriesByKey($StartDate); my $Entry = $Entries->GetFirstEntry(); print "Documents with Start Date $start_date\n"; while ($Entry) { my $doc = $Entry->Document(); my $subj = $doc->GetFirstItem('Subject')->{Text}; print "Subject: $subject\n"; $Entry = $Entries->GetNextEntry($Entry); }

Replies are listed 'Best First'.
Re: Lotus Notes documents by Date keys
by diotalevi (Canon) on May 24, 2007 at 02:52 UTC

    I wrote a small pile of Lotus Notes themed nodes here. Super Search for things written by me that mention Lotus and OLE.

    ⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

      Thanks. I've been doing Lotus Notes perl programming for exactly two days now, which started when someone suggested that we all start cutting and pasting screen shots from the Notes GUI into our Word documents. The ActiveState 'Using OLE with Perl' FAQ and the Win32::OLE::TPJ pod is also a big help, as well as the links in the FAQ to the Notes OLE docs at lotus.com which is now at IBM.
      Is there a way to login to Lotus notes database through URL login Page and access through mails using Perl program... please help me!

        Yes, that is an ordinary WWW::Mechanize interaction. You'll need to solve the no-JavaScript problem.

        ⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: CUFP [id://617131]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-25 09:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found