If you have AS Perl installed, it comes with a nice little object browser that you can use to investigate all those wonderful properties a contact item can have. You are interested in looking at the ContactItem class of the Application Objectuse strict; use Win32::OLE qw(in with); use Win32::OLE::Const 'Microsoft Outlook'; $|++; $Win32::OLE::Warn = 3; # Die on errors my $OL = Win32::OLE->GetActiveObject('Outlook.Application') || Win32::OLE->new('Outlook.Application', 'Quit'); my $NameSpace = $OL->GetNameSpace("MAPI"); #You can also use $NameSpace->GetDefaultFolder(olFolderContacts) if yo +u #just want to put them in the default. my $Contacts = $NameSpace->Folders("Personal Folders")->Folders(" +Contacts"); my $NewContact = $Contacts->Items->Add(); $NewContact->{FullName}="Your Name Here"; $NewContact->{PagerNumber}="xxx.xxx.xxxx"; $NewContact->Save(); #And there are about 175 other properties that you can set.
The browser was conveniently located at:
c:\perl\html\site\lib\win32\ole\browser\browser.html
Hope that helps a bit.
C-.
In reply to Re: Perl control of Outlook import to contacts with win32::OLE
by cacharbe
in thread Perl control of Outlook import to contacts with win32::OLE
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |