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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Perl Outlook Calendars

Status
Not open for further replies.

timgerr

IS-IT--Management
Jan 22, 2004
364
US
Not sure if anyone has used perl and outlook scripts but here I go.
OK I have found a little information on Perl and Outlook calendars. I
have a few questions that I want to ask. If I have myltiple calendars
in Outlook can I tell the OLE to use different ones? I have 2
calendars, test1 (default) and test 2. I want to query both calenders,
can this be done? The other question is I am trying to get all the
output in the hash ( I think it is a hash) $message. When the part
runs print "Start = " . $message->{Start}."\n";
I get this output Start = Win32::OLE::Variant=SCALAR(0x182a9b8).
How can I find out what is in this scalar? Any information would be
great.

Here is my code:

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

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";

-How important does a person have to be before they are considered assissinated instead of just murdered?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top