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); }

In reply to Lotus Notes documents by Date keys by runrig

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.