ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl-win32-users
perl-win32-users
Re: Outlook, Perl & OLE - Journal Entries?
by Martin Moss other posts by this author
Nov 6 2002 6:25PM messages near this date
view in the new Beta List Site
RE: Outlook, Perl & OLE | locales reference?
Just as a matter of interest has anybody found a way to manipulate journal
entries, and perhaps merge them between different computers?


Marty



----- Original Message -----
From: "Ricci, Mark" <mricci@[...].com> 
To: "Perl-Win32-Users" <perl-win32-users@[...].com> 
Sent: Wednesday, November 06, 2002 2:30 PM
Subject: RE: Outlook, Perl & OLE


>  -----Original Message-----
>  From: Charbeneau, Chuck [mailto:CCharbeneau@[...].com]
>  Sent: Wednesday, November 06, 2002 8:00 AM
>  To: 'Harald Wopenka'; Perl-Win32-Users
>  Subject: RE: Outlook, Perl & OLE
> 
> 
>  > From: Harald Wopenka [mailto:hwopenka@[...].at]
>  > Subject: Outlook, Perl & OLE
>  >
>  >
>  > Hi there,
>  > does anybody know a good source of examples and/or
>  > descriptions how to manipulate MS Outlook? I want to access
>  > my contacts (read, create, delete) and calendarentries... tia Harry
> 
> 
>  Well, I can get you started with Contacts, and you should be able to take
it
>  from there to your calendar.  If you have problems beyond that, ask.
> 
>  <CODE>
>  use strict;
>  use Win32::OLE qw(in with);
>  use Win32::OLE::Const 'Microsoft Outlook';
>  $|++;
>  $Win32::OLE::Warn = 3; # Throw Errors, I'll catch them
> 
>  my $OL = Win32::OLE->GetActiveObject('Outlook.Application')
>      || Win32::OLE->new('Outlook.Application', 'Quit');
> 
>      my $NameSpace = $OL->GetNameSpace("MAPI");
>      my $Contacts =  $NameSpace->Folders("Personal
>  Folders")->Folders("Contacts");#GetDefaultFolder(olFolderContacts);
> 
>      my @names = qw(Chuck Charles Charlie Chuckles);
>      foreach my $name (@names){
>          my $NewContact = $Contacts->Items->Add();#($NewContact);
>             $NewContact->{FirstName}=$name;
>             $NewContact->{LastName}="Charbeneau";
>             $NewContact->Save();
>             print "Added $name\n";
>      }
> 
>      $Contacts =  $NameSpace->Folders("Personal
> 
Folders")-> Folders("Contacts")->{Items};#GetDefaultFolder(olFolderContacts);
>      my $Cacharbes = $Contacts->Find("[LastName]=Charbeneau");
>      my $cnt = 0;
>      while (1) {
>        print $Cacharbes->{FirstName}." : ".$Cacharbes->{EntryID}."\n";
>        if ($Cacharbes->{FirstName} eq "Chuckles"){
> 
>            $Cacharbes->Delete();
>        }
>        $Cacharbes = $Contacts->FindNext() || last;
>     }
> 
>  </CODE>
> 
>  Chuck.
>  _______________________________________________
>  Perl-Win32-Users mailing list
>  Perl-Win32-Users@[...].com
>  To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> 
> 
> 
>  Would this script be run against a PST file or can it be run against a
>  mailbox on an exchange server?
>  I'm running it against a mailbox and I get:
> 
>  OLE exception from "Microsoft Outlook":
> 
>  The operation failed. An object could not be found.
> 
>  Win32::OLE(0.1502) error 0x8004010f
>      in METHOD/PROPERTYGET "Folders" at C:\My
>  Documents\scripts\perlscripts\Outlook\ou
>  kcontract.pl line 11
> 
> 
>  Which would be this line in the script:
>      my $Contacts =  $NameSpace->Folders("Personal Folders
>  ")->Folders("Contacts");#GetDefaultFolder(olFolderContacts);
> 
> 
>  Any ideas?
> 
>  Mark
> 
> 
>  This e-mail message is for the sole use of the intended recipient(s) and
may
>  contain confidential and/or privileged information.  Any review, use,
>  disclosure or distribution by persons or entities other than the intended
>  recipient(s) is prohibited.  If you are not the intended recipient, please
>  contact the sender by reply and destroy all copies of the original
message.
>  Thank you.
> 
>  WordWave, Capturing the Power of the Spoken Word
>  http://www.wordwave.com
> 
> 
>  _______________________________________________
>  Perl-Win32-Users mailing list
>  Perl-Win32-Users@[...].com
>  To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> 

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Ricci, Mark
Martin Moss

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved