How to set a COM Object property to TRUE

B

bmw108

Hello,

I am trying to set a WIN32 COM Object bool property true to enable a
validation option.

I can do it in VB like so.

emailPtr.CorrectSyntax = True

How do I do it in PERL?

I have tried so many different things to no avail.

$emailObj->{MxLookup} = (TRUE);
$emailObj->{MxLookup} = $TRUE;
$emailObj->{MxLookup} = 1;
$emailObj->{MxLookup} = TRUE;

Can anyone help?
 
K

kevincar

Hi-

Hello,

I am trying to set a WIN32 COM Object bool property true to enable a
validation option.

I can do it in VB like so.
[---]

Can anyone help?

A little code snippet that works for me;

use strict;
use Win32::OLE;
use Win32::OLE::Variant;
use constant FALSE => Variant( VT_BOOL, 0);
use constant TRUE => Variant( VT_BOOL, 1);

.... and depending upon the COM object's coding, you might have to set
the property like:

$crRpt->Invoke("YOUROBJPROPERYNAME", FALSE);

....or
$crRpt->Options->SetProperty("YOUROBJPROPERYNAME", FALSE);


All the best, HTH

KC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top