Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Check your property Names in the Outlook ContactItem Class

by cacharbe (Curate)
on May 24, 2002 at 12:15 UTC ( [id://169031]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Perl control of Outlook import to contacts with win32::OLE
in thread Perl control of Outlook import to contacts with win32::OLE

I can tell you right off the top that a bunch of your property names are incorrect. Here is what the property names should be (I've only included the ones to which you were actually giving data):
$NewContact->{FullName}= $rec->{first_name} . ' ' . $rec->{last_name}; $NewContact->{Title} = $rec->{title}; $NewContact->{FirstName} = $rec->{first_name}; $NewContact->{LastName} = $rec->{last_name}; $NewContact->{BusinessTelephoneNumber} = join '-', $rec->{prefix1}, $rec->{suffix1}; if ($rec->{prefix2}){ $NewContact->{Business2TelephoneNumber} = join '-', $rec->{prefix2}, $rec->{suffix2}; } else { $NewContact->{Business2TelephoneNumber} = '27'; } $NewContact->{CompanyName} = $rec->{company}; $NewContact->{PrimaryTelephoneNumber} = join '-', $rec->{prefix1}, $rec->{suffix1}; $NewContact->{OfficeLocation} = $rec->{location}; $NewContact->{User1} = $rec->{site}; $NewContact->{"Email1Address"} = 'mytest@mytest.com';
See if that helps. Use that browser that I pointed out to actually investigate the 'ContactItem' class object, and use the exact name given for the other properties in question.

C-.

Update: To answer your other questions. You should read the Win32::OLE documentation first. The GetActiveObject method is described there, as it's a part of that package.

Replies are listed 'Best First'.
Re: Re: Check your property Names in the Outlook ContactItem Class
by Anonymous Monk on May 24, 2002 at 15:27 UTC
    Oh wise C, I wish to thank you for this help. You have given me the tools to finish a very important project. Thanks again.
      Null Perspiration.

      cacharbe's the name, Win32:OLE is my game.

      C-.

        C, Here I am bothering you again. I have had much success thanks to your instruction. I have been very successful in finding and deleting items from contacts folder. Here is my question: I have the following snipet:
        my $NewContact = $Contacts->Items->find("[Last Name] = $name"); print "full name: $NewContact->{FullName}\n"; print "First name: $NewContact->{FirstName}\n"; print "Last name: $NewContact->{LastName}\n"; print "Phone: $NewContact->{BusinessTelephoneNumber}\n"; print "Title: $NewContact->{CompanyName}\n"; $NewContact->Delete();
        Now there may be a bunch of Smiths and I don't want to trash all of them - How can I do this same thing by index. The whole index deal leaves me a little lost - how do I return and index to script? Thanks

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://169031]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2024-04-19 19:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found