in reply to Re: Outlook Write to Calendar
in thread Outlook Write to Calendar

OK here is what I have, I am getting into some troubles, the script is failing at the last line. I am getting the error "Can't call method "Items" on an undefined value at Untitled11.pl line 9." Not sure what to do here,
Thanks for all the help
nanojack
use Win32::OLE; use Win32::OLE::Const 'Microsoft Outlook'; # Connection to Outlook Calendar my $outlook = Win32::OLE->new('Outlook.Application') or die "Error!\n"; my $namespace = $outlook->GetNamespace("MAPI"); my $app = $namespace->CreateItem(olAppointmentItem); my $CalendarFolderItems = $app->Items;
-How important does a person have to be before they are considered assassinated instead of just murdered?

Replies are listed 'Best First'.
Re^3: Outlook Write to Calendar
by blm (Hermit) on Dec 20, 2005 at 03:02 UTC
    I read this code sample and interpret as following. You are trying to retrieve the collection of appointments in outlook. However what you seem to be doing is creating a single appointment in
    my $app = $namespace->CreateItem(olAppointmentItem);

    and trying to retrieve the Items collection of the Appointment. Perl is telling you that there is no Items collection attached to an Appointment Item.

    Look at your first question and try something allong the lines of:

    1. Retrieve the Namespace
    2. Get the DefaultFolder that contains Calendar objects.
    3. Retrieve collection of appointments
    4. With the collcation add an appointment.