Win32::OLE problem

I

Iain McLaren

Hi,

I'm trying to write a little perl script to enter contacts into a Lotus
Notes address book using Win32::OLE. I am basing it on a VBA script that I
found:

<snip>
Set NotesDoc = NotesDB.CreateDocument
With NotesDoc
.ReplaceItemValue "Form", "Person"
.ReplaceItemValue "CompanyName", "Nuclear Plant"
.ReplaceItemValue "FirstName", "Homer"
.ReplaceItemValue "LastName", "Simpson"
.ReplaceItemValue "JobTitle", "Saftey Inspector"
.ComputeWithForm True, False
.Save True, False
End With
<snip>

I can't figure out how to convert the ReplaceItem statements to Perl syntax.
I thought it would be something like this:

<snip>
my $newdoc = $Database->CreateDocument;
$newdoc->ReplaceItemValue({FirstName => 'Marge', LastName => 'Simpson', Type
=> 'Person'});
$newdoc->Save;
<snip>

This runs without generating an error, but doesn't seem to do anything
either :-/

Could anyone point me in the right direction? Any help greatly
appreciated!!!

Thanks,

Iain
 
I

Iain McLaren

I've worked it out! The statement needs to be in the form:

$newdoc->ReplaceItemValue(Type, 'Person');
etc

Iain
 
D

Dr.Ruud

Iain McLaren schreef:

$newdoc->ReplaceItemValue(Type, 'Person');


Alternatives:

$newdoc->ReplaceItemValue(Type => 'Person');

$newdoc->ReplaceItemValue('Type' => 'Person');
 
I

Iain McLaren

I think I tried them in the course of my investigation (ie guesswork)
without success... I may be wrong though :)

Cheers,

Iain
 

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top