How to set a COM Object property to TRUE

Discussion in 'Perl Misc' started by bmw108@gmail.com, Sep 25, 2007.

  1. Guest

    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?
     
    , Sep 25, 2007
    #1
    1. Advertising

  2. kevincar Guest

    Hi-

    On Sep 25, 1:03 pm, 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
     
    kevincar, Sep 26, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Wier
    Replies:
    0
    Views:
    633
    David Wier
    Aug 27, 2003
  2. Matthew Louden
    Replies:
    1
    Views:
    450
    bruce barker
    Nov 18, 2003
  3. Matthew Louden
    Replies:
    8
    Views:
    565
    John Saunders
    Nov 19, 2003
  4. Mattias Sjögren
    Replies:
    2
    Views:
    591
  5. bdb112
    Replies:
    45
    Views:
    1,370
    jazbees
    Apr 29, 2009
Loading...

Share This Page