Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Perl and Outlook Calendars?

Status
Not open for further replies.

hazg

Programmer
Dec 14, 2004
10
FR
Hello all,

I'm writing a script to extract some calendar data from Outlook 2000 and present it in a .csv format. The extraction code so far is thus...

use Win32::OLE;
use Win32::OLE::Const 'Microsoft Outlook';
use Win32::OLE::Variant;

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;

for my $itemIndex (1..$items->Count)
{
my $message = $items->item($itemIndex);
next if not defined $message;

print "Subject = " . $message->{Subject}."\n";
print "Start = " . $message->{Start}."\n";
print "End = " . $message->{End}."\n";
}

However, I need to extract more than just the subject, start and end times from each appointment. I have tried the obvious but have been unable to find the names of any additional constants (such as 'location'). Theres seems to be nothing about this on CPAN.

Any ideas what the other constants are?

Thanks
 
I'm not sure which one's you've tried, but I have also used these ones:


print "End = " . $message->{End}."\n";
print "End = " . $message->{Duration}."\n";
print "End = " . $message->{Location}."\n";

There are some useful examples on Technet, but you have to translate to Perl yourself -eg.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top