Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

What is the perl equivalent of vba

by Anonymous Monk
on Jan 31, 2005 at 10:39 UTC ( [id://426546]=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi

What is the perl equivalent of vba code line 1

0: dim str as string, Rng as range 1: str =Rng.style
I tried to use as follows
$str = $rng->{style}

But it returns an hash. im trying to get the style name of the range object

Pls help

Replies are listed 'Best First'.
Re: What is the perl equivalent of vba
by thinker (Parson) on Jan 31, 2005 at 10:50 UTC

    Hi there,

    Ok, I am assuming you have an object, $rng, of some type, and it has a style() method, you can call it by  $str = $rng->style();

    cheers

    thinker

      Really, the previous code is correct. The instance variable of the object is accessed in these form, or

      $str = $$rng{style};

      Bye.
Re: What is the perl equivalent of vba
by maa (Pilgrim) on Jan 31, 2005 at 15:35 UTC

    Since each Office Application has its own API you'll need to tell us if this is Word, Excel or PowerPoint... then we'll maybe be able to help.

Re: What is the perl equivalent of vba
by gube (Parson) on Feb 01, 2005 at 04:59 UTC

    Hi, try this with OLE module

    Please open the word document and use this

    use Win32::OLE; use Win32::OLE qw(in with); use Win32::OLE::Const 'Microsoft Word'; $word=Win32::OLE->GetActiveObject('Word.Application'); $doc= $word->activedocument; foreach my $val (in $doc->styles){ push @styles,$val->{namelocal}; } $"="\n"; print "@styles";

    Regards,
    Gubendran.L

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://426546]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-04-25 17:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found