Reply to Re: Outlook Com access

Your name:

Reply:


Posted by Steve on 10/25/05 12:22

> I'm trying to develop a personal start page on my machine that would
> have my outlook calendar on the page. I've seen Konfabulator widgets


I'm feeling generous today... I couldn't get the filter to work in the
time available, so that's an exercise for the reader.


<?php

set_time_limit(0);

// 2005-10-25 sa [googlespam@nastysoft.com]
// no rights reserved, no refunds

define( 'olFolderCalendar', 9 );
$objOLApp = new COM("Outlook.Application") or die("Unable to
instantiate Outlook");
print "Outlook v" . $objOLApp->Version() . "<br><br>\n";
$objNameSpace = $objOLApp->GetNamespace('MAPI');
$objCalendarFolder = $objNameSpace->GetDefaultFolder(
olFolderCalendar );
$objCalendarItems = $objCalendarFolder->Items();
$objCalendarItems->IncludeRecurrences = 0;
$objCalendarItems->Sort( '[Start]' );

/* OT: SADLY, THIS FAILS TO FILTER ITEMS - ANYONE KNOW WHY? */
$objCalendarItem = $objCalendarItems->Find( '[Start]>="01-Jul-2005
12:00 AM"' );

while( $objCalendarItem )
{
$lngStartDate = $objCalendarItem->Start();
// manually filter - could take a long time...
if( $lngStartDate >= mktime( 0, 0, 0, 6, 1, 2005 ) )
{
$strStartDate = date( 'd-M-Y', $lngStartDate );
$strStartTime = date( 'H:i', $lngStartDate );
$lngDuration = $objCalendarItem->Duration() / 60;
switch( $lngDuration )
{
case 0: $strTimeDuration = $strStartTime . " (Reminder)";
break;
case 24: $strTimeDuration = "all day"; break;
default: $strTimeDuration = $strStartTime . " " . strval(
$lngDuration ) . " hrs"; break;
}
$strSubject = $objCalendarItem->Subject();
print $strStartDate . " - " . $strTimeDuration . " - " .
$strSubject . "<br>\n";
}
$objCalendarItem = $objCalendarItems->FindNext();
}

unset( $objCalendarItem );
unset( $objCalendarItems );
unset( $objCalendarFolder );
unset( $objNameSpace );

unset( $objOLApp );

?>


---
Steve

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация