Well, working your way through the wizard is a PIA, especially since you can add them yourself directly through the OLE interface.
use 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.
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 Object

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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.