Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > How to set a COM Object property to TRUE

Reply
Thread Tools

How to set a COM Object property to TRUE

 
 
bmw108@gmail.com
Guest
Posts: n/a
 
      09-25-2007
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?

 
Reply With Quote
 
 
 
 
kevincar
Guest
Posts: n/a
 
      09-26-2007
Hi-

On Sep 25, 1:03 pm, (E-Mail Removed) 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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
[False,True] and [True,True] --> [True, True]????? bdb112 Python 45 04-29-2009 02:35 AM
why some controls must set autopostback property to be true?? Matthew Louden ASP .Net 8 11-19-2003 12:06 AM
why some controls must set autopostback property to be true?? Matthew Louden ASP .Net 1 11-18-2003 02:16 AM
Re: why radio button needs to set AutoPostBack property=True?? David Wier ASP .Net 0 08-27-2003 05:15 PM



Advertisments