Working on a small project to read a personal outlook calendar looking for corrupt data. I believe I have corrupt data in an recurring calendar event. The Following code started from: http://www.perlmonks.org/?node_id=660500 And am looking to add reference to recurring items from this http://www.microsoft.com/technet/scriptcenter/resources/officetips/sept05/tips0901.mspx The issue I'm having is I don't understand how to access the data structure RecurrancePattern and its objects. Here is the semi working code - Pulls calendar data and only displays if its a recurring calendar item.
use Win32::OLE; use Win32::OLE::Const 'Microsoft Outlook'; my $outlook = Win32::OLE->new('Outlook.Application') or die "Error!\n"; my $counter; my $namespace = $outlook->GetNamespace("MAPI"); my $cal = $namespace->GetDefaultFolder(olFolderCalendar); my $items = $cal->Items; #$appts->{IncludeRecurrences} = 'True'; #$items->Filter{IsRecurring} = 'True'; for my $itemIndex (1..$items->Count) { my $appts = $items->item($itemIndex);# or die("error getting cal appts +: " . Win32::OLE->LastError()); #print Win32::OLE->LastError(); #next if not defined $appts; if ($appts->{IsRecurring} >= 1 ) { my $pattern = $apps->{RecurrencePattern}; $counter++; print "\n\n"; print "subject = " . $appts->{Subject}."\n"; print "Start = " . $appts->{Start}->Date."\n"; print "Organizer = " . $appts->{Organizer}."\n"; print "Start Time = " . $appts->{Start}->Time."\n"; print "End = " . $appts->{End}->Date."\n"; print "End time = " . $appts->{End}->Date."\n"; print "Duration = " . $appts->{Duration}."\n" ; #1 minute print "Location = " . $appts->{Location} ."\n"; print "body = " . $appts->{Body} ."\n"; print "ReminderMinutesBeforeStart = " . $appts->{ReminderMinutesBefore +Start} ."\n"; print "BusyStatus = " . $appts->{BusyStatus} ."\n"; print "AllDaEvent = " . $appts->{AllDayEvent} ."\n"; print "EntryID = " . $appts->{EntryID} ."\n"; print "CreationTime = " . $appts->{CreationTime}->Date, " ",$appts->{C +reationTime}->Time."\n"; print "IsRecurring = " . $appts->{IsRecurring} ."\n"; print "Pattern Start = " . $appts->{RecurringPattern}->{StartDate}."\n +"; print "Pattern End = " . $appts->{RecurringPattern}->{EndDate}."\n"; } } print $counter . "Total Recurring items\n";

In reply to Reading Outlook recurring events by freebsdboy

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.