Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Perl Misc (http://www.velocityreviews.com/forums/f67-perl-misc.html)
-   -   How to set a COM Object property to TRUE (http://www.velocityreviews.com/forums/t904734-how-to-set-a-com-object-property-to-true.html)

bmw108@gmail.com 09-25-2007 08:03 PM

How to set a COM Object property to TRUE
 
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?


kevincar 09-26-2007 09:25 PM

Re: How to set a COM Object property to TRUE
 
Hi-

On Sep 25, 1:03 pm, bmw...@gmail.com wrote:
> 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





All times are GMT. The time now is 07:20 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.