hail monks,
i am writing a perl script to display the items in an outlook calendar. i have outlook 2000 installed locally on my computer, i am NOT using exchange or anything. here is the code i have so far:
#!/usr/bin/perl
use warnings;
use strict;
use Win32::OLE;
# ----------------------------------------
print "Content-type:text/html\n\n";
my $ol = Win32::OLE->new('Outlook.Application') or die "error\n";
my $olns = $ol->GetNameSpace("MAPI") or die "can't open MAPI namespace
+\n";
my $folder = $olns->GetDefaultFolder(9);
my $items = $folder->{Items};
for my $index (1 .. $items->{Count})
{
print $items->Item($index)->{Subject} . "\n";
print $items->Item($index)->{Body} . "\n";
print $items->Item($index)->{Start} . "\n";
print $items->Item($index)->{End} . "\n";
}
it works fine running through CMD, but when i try to run it through IIS, it just hangs and does nothing. i also get an error in event viewer stating: "the server { ... } did not registe with DCOM within the required timeout."
i read on google groups that i should use CDO or extended mapi... not quite sure how to go about this, i dont know if there is an easier way with the code i have?
thanks monks!
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.