I am sort of new to Perl and I have been trying to work with OLE and Outlook Calendar. I am parsing the calendar but I am having troubles with getting the reminders function. This is the part that I am having troubles and cannot find out what I am doing wrong ($message->{AppointmentItem}->ReminderMinutesBeforeStart;)
Thanks for any information.
Happy
Here is what I have:
use Win32::OLE; use Win32::OLE::Const 'Microsoft Outlook'; # Going to open a file to write too # file location my $outlook = Win32::OLE->new('Outlook.Application') or die "Error!\n"; my $namespace = $outlook->GetNamespace("MAPI"); my $folder = $namespace->GetDefaultFolder(olFolderCalendar); my $items = $folder->Items; print length($folder) . "\n"; for my $itemIndex (1..$items->Count) { my $message = $items->item($itemIndex); next if not defined $message; $start_date = $message->{Start}->Date; $start_time = $message->{Start}->Time; $end_date = $message->{End}->Time; $end_time = $message->{End}->Time; $duration = $message->{Duration}; $subject = $message->{Subject}; $categories = $message->{Categories}; $body = $message->{Body}; $reminder = $message->{AppointmentItem}->ReminderMinutesBeforeSt +art; # AppointmentItem.ReminderSet print "*****************************************\n"; print "Start Date " . $start_date . "\n"; print "Start Time " . $start_time . "\n"; print "End Date " . $end_date . "\n"; print "End Time " . $end_time . "\n"; $duration_1 = ($duration / 60); print "Duration " . $duration_1 . " hrs\n"; print "\n"; print "\n"; print "Subject " . $subject . "\n"; print "Categories " . $categories . "\n"; print "Body " . $body . "\n"; print "Reminder " . $reminder . "\n"; }

In reply to Perl and outlook by Happy-Jack

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.