Re: Perl with Outlook Calendar
by Corion (Patriarch) on Sep 06, 2001 at 15:19 UTC
|
You will have to use Win32::OLE and the Outlook Object Model,
which should be documented in the MSDN. I've
done this already, and if you only want to retrieve
data from the Outlook Object Model, it's relatively simple
as long as you stay with what Outlook delivers.
If you dare to venture into the realms of shared calendars
and Exchange servers, you're in for a different bag.
Here
is one node by me, discussing the basics of using
Outlook via Win32::OLE, and here
is a fully functional (Win32) snippet, which extracts
all phone numbers from Contact Items. You would want
Calendar Items instead, but the modifications are trivial
as soon as you found the map of the Outlook Object Model on the MSDN.
| [reply] |
|
| [reply] |
|
Writing to Exchange is easy as long as you can use the Outlook Object Model. When I used the Outlook Object Model to do live caller-id lookup against a contacts database of about 400 Contact Items on an Exchange (4) server, I found the Outlook Object Model to be abysmally slow for searching through all these contacts. I had (not with Perl, mind you) to turn to true MAPI, which is more or less like SQL without the ASCII command syntax, and you have to manage the result tables yourself. MAPI has the great performance you'd expect from a relational database, but interfacing MAPI to Perl is really hard.
To set the value of a property via the OOM, just assign to that property. As (I guess) this will be a one off job, time is not that important, and you can try to use the Outlook Object Model. Stuff you can't do with the OOM is for example change or preserve sociations between Outlook Items, as there is not much way to get at the MAPI unique item IDs.
| [reply] |
Re: Perl with Outlook Calendar
by idnopheq (Chaplain) on Sep 06, 2001 at 14:44 UTC
|
If you have ActiveState's perl for Win32, there's an OLE Browser included in the on-line documentation. Use that info w/ Win32::OLE to get and put data into your Outlook calendar.
I had something like this, once. But unfortunately my current employer feels the need to force Notes on us.
HTH
--
idnopheq
Apply yourself to new problems without preparation, develop confidence in your ability to to meet situations as they arrise.
| [reply] |
|
I had to do something similar using Adobe Acrobat once. Win32::OLE plus the Acrobat Object Model (and Perl, of course) saved the day.
dmm
Just call me the Anti-Gates ...
| [reply] |
Re: Perl with Outlook Calendar
by petdance (Parson) on Sep 06, 2001 at 16:51 UTC
|
I'll just echo what everyone else said about using the Outlook
object model. I believe that in the back of
Outlook 2000 In A Nutshell there's a
high-level chart of the object model. (Remembering back to a year ago when I had a similar project...)
xoxo,
Andy
--
<megaphone>
Throw down the gun and tiara and come out of the float!
</megaphone>
| [reply] |
Re: Perl with Outlook Calendar
by elwarren (Priest) on Sep 07, 2001 at 03:07 UTC
|
There is also this script in the CUFP section that will stuff a text file into an Outlook note. Was just looking for it myself to move some data into my new PocketPC.
HTH | [reply] |
Re: Perl with Outlook Calendar
by thraxil (Prior) on Sep 07, 2001 at 07:03 UTC
|
| [reply] |
Re: Perl with Outlook Calendar
by Anonymous Monk on Jan 12, 2002 at 08:00 UTC
|
I read your note while looking for help with reading from the Outlook calendar. I have done some programming based on what I could glean frome sites and from the MSDN <shudder> and have posted my code to the Monks. This program should be able to help you out with reading of the data.
A helpful tool was once I had gotten the items, I did a foreach loop of them like this:
my $calitems = $namespace->GetDefaultFolder(olFolderCalendar)->{Items}
+;
my $it = $calitems->GetFirst; #get the first Appointment item
foreach my $key (keys %$it)
{ print "$key = $it->{$key}\n"; }
For things that get printed out as Win32::OLE::Variant take a look at Win32::OLE::Variant documentation.
And once you get used to how they do things, the MSDN is a good resource.
-- David Weand (dweand@vt.edu) | [reply] [d/l] |