Win32::OLE Beginner Advice

Discussion in 'Perl Misc' started by olson_ord@yahoo.it, Jan 14, 2006.

  1. Guest

    Hi,
    I am interested in learning Windows Automation using perl i.e.
    Win32::OLE I have downloaded Active State Perl - and also taken a
    look at its documentation, but I did not understand anything. I want to
    know if there is something I can read up to understand how to start.

    I know a bit of C++ and Java. I liked the documentation system in Java
    where each of the functions of a class are clearly mentioned. Is there
    anyway to get something similar for Win32::OLE?

    For e.g. I was trying to click a button on a webpage - but this
    button does not have a name. (This can be accessed by going to
    http://mail.yahoo.com/)

    <p class="yreglgsb"><input type="submit" value="Sign In"></p>

    I can probably do something like

    my $oIE = Win32::OLE->new('InternetExplorer.Application');

    ..... Some code to start IE

    $oIE->Document->form_name->submit();

    where form_name is the form where this button exists. However this does
    not work. So I want to know about the hierarchy of Document. In java
    this would simply require me to look at the java documentation.

    I have taken a look at what cspan has for Win32-OLE - but that does
    not help. Also I have looked at the active state OLE documentation -
    but I really don't know where to look.

    I hope someone has some idea.
    O.O.
    , Jan 14, 2006
    #1
    1. Advertising

  2. Matt Garrish Guest

    <> wrote in message
    news:...
    > Hi,
    > I am interested in learning Windows Automation using perl i.e.
    > Win32::OLE I have downloaded Active State Perl - and also taken a
    > look at its documentation, but I did not understand anything. I want to
    > know if there is something I can read up to understand how to start.
    >


    Win32-OLE is, amazingly enough, just an interface to OLE. If you don't
    understand OLE automation, don't look to the Perl documentation. ActiveState
    provides an OLE browser, but you might have to jump through a few hopes in
    XP to get it to work. The general trick for Office automation is to record a
    macro of what you hope to accomplish and then translate it to Perl using
    what bit of documentation exists (usually along the line of change . to ->,
    with very little other help at least the last time I went looking). Expect a
    long frustrating trial-and-error experience if you're looking to do anything
    beyond the very simple.

    >
    > For e.g. I was trying to click a button on a webpage - but this
    > button does not have a name. (This can be accessed by going to
    > http://mail.yahoo.com/)
    >


    Don't waste your time trying to automate IE, unless you absolutely need to
    for some reason. The LWP family of modules can be used to submit form data
    and for a variety of other Web browsing tasks.

    Matt
    Matt Garrish, Jan 14, 2006
    #2
    1. Advertising

  3. Guest

    Thanks Matt for your response. I am actually just interested in
    automation of IE and not Office. I have recorded Office macros in the
    past - and have also edited them.

    If you have not guessed it by now, I need IE to automate my email. I
    have 3 accounts and need to keep track of them. The problem that I am
    facing is that many of the current packages just support plain HTML -
    however recent stuff with stylesheets etc are not supported.

    Regards,

    O.O.
    , Jan 15, 2006
    #3
  4. wrote:
    > Thanks Matt for your response. I am actually just interested in
    > automation of IE and not Office. I have recorded Office macros in the
    > past - and have also edited them.
    >
    > If you have not guessed it by now, I need IE to automate my email. I
    > have 3 accounts and need to keep track of them. The problem that I am
    > facing is that many of the current packages just support plain HTML -
    > however recent stuff with stylesheets etc are not supported.
    >


    Do your email providers not supply a POP/IMAP interface? It would be a
    lot less effort to code something to manipulate your mail this way
    rather than worrying about web interfaces.

    Anyway, you could probably still accomplish your task using
    LWP::UserAgent or WWW::Mechanize. Lack of stylesheet support is probably
    a non-issue: stylesheets affect the display, not the functionality. Lack
    of javascript support could be an issue, but you can probably find a way
    around it by working out what calls the javascript makes and following
    links / clicking buttons directly.

    Mark
    Mark Clements, Jan 15, 2006
    #4
  5. Dr.Ruud Guest

    [OT] quoting (was: Re: Win32::OLE Beginner Advice)

    schreef:
    > I am actually just interested


    For Olson Ord, and everybody else with "User-Agent: G2/#.#":

    "How can I automatically quote the previous message
    when I post a reply?"
    http://groups.google.co.uk/support/bin/answer.py?answer=14213

    See also:
    http://www.safalra.com/special/googlegroupsreply/


    What's good 'netiquette' when posting to Usenet?
    http://groups.google.co.uk/support/bin/answer.py?answer=12348
    http://directory.google.com/Top/Computers/Usenet/Etiquette/

    But Google needs you to vote for 'Default quoting of
    previous message in replies'
    http://groups-beta.google.com/support/bin/request.py?contact_type=features

    --
    Affijn, Ruud

    "Gewoon is een tijger."
    Dr.Ruud, Jan 15, 2006
    #5
  6. Guest

    Re: quoting (was: Re: Win32::OLE Beginner Advice)

    How is this related to the Original Post. I am new to using groups -
    so its not obvious to me.
    However if there is no reason - please don't hijack someone
    else's thread.
    O.O
    , Jan 16, 2006
    #6
  7. Guest

    Mark Clements wrote:

    > Do your email providers not supply a POP/IMAP interface? It would be a
    > lot less effort to code something to manipulate your mail this way
    > rather than worrying about web interfaces.


    Thanks Matt for your suggestions. I don't want to have these emails
    on my hard-drive, because I move a lot.

    > Anyway, you could probably still accomplish your task using
    > LWP::UserAgent or WWW::Mechanize. Lack of stylesheet support is probably
    > a non-issue: stylesheets affect the display, not the functionality.


    I do not know much HTML. However I get things like

    <li id="inbox" class="newmessages" title="Navigate to the Inbox
    folder"><a href="/ym/ShowFolder?rb=Inbox&reset=1&YY=70986"
    title="Navigate to the Inbox folder">Inbox (149)</a></li>

    which are enclosed in multiple levels of DIV tags - so I thought that
    they were related to style sheets.

    WWW::Mechanize does not really work, because when I ask it to get all
    links on a webpage - such kinds of links are never returned.


    For now I am thinking of using module - MailClientYahoo-1.0 - but I
    have not yet looked at it. I am not sure if this is linked to the yahoo
    US website - or this would work for others also. I would need to take
    a look at it once I get some time.

    Thanks a lot.
    O.O.
    , Jan 16, 2006
    #7
  8. Re: quoting (was: Re: Win32::OLE Beginner Advice)

    wrote:
    > How is this related to the Original Post.


    How is _WHAT_ related to the OP?
    Please quote an appropriate amount of the article that you are refering
    to -as has been customary for the past two decades- such that your readers
    have a chance to understand what you are talking about.

    > I am new to using groups -
    > so its not obvious to me.


    As you didn't quote any context it is impossible to know, let alone explain,
    because we don't know _what_ is not obvious to you.

    > However if there is no reason - please don't hijack someone
    > else's thread.


    That is a good rule in any case.

    jue
    Jürgen Exner, Jan 16, 2006
    #8
  9. wrote:
    > Mark Clements wrote:
    >
    >> Do your email providers not supply a POP/IMAP interface? It would be a
    >> lot less effort to code something to manipulate your mail this way
    >> rather than worrying about web interfaces.

    >
    > Thanks Matt for your suggestions. I don't want to have these emails
    > on my hard-drive, because I move a lot.


    With IMAP, the emails can be manipulated directly on the server. With
    POP, normally they are downloaded *and* saved but this isn't obligatory.
    You *could* just download them (leaving them on the server as well), and
    then read the necessary bits. If POP or IMAP are available, I would use
    them in preference to fighting with an HTML interface.

    >
    >> Anyway, you could probably still accomplish your task using
    >> LWP::UserAgent or WWW::Mechanize. Lack of stylesheet support is probably
    >> a non-issue: stylesheets affect the display, not the functionality.

    >
    > I do not know much HTML. However I get things like
    >
    > <li id="inbox" class="newmessages" title="Navigate to the Inbox
    > folder"><a href="/ym/ShowFolder?rb=Inbox&reset=1&YY=70986"
    > title="Navigate to the Inbox folder">Inbox (149)</a></li>
    >
    > which are enclosed in multiple levels of DIV tags - so I thought that
    > they were related to style sheets.
    >
    > WWW::Mechanize does not really work, because when I ask it to get all
    > links on a webpage - such kinds of links are never returned.


    Example code? Example HTML? Mechanize really does work for me. If there
    is content being generated by document.write, then I can see that being
    issue, though (hadn't thought of this before).
    >
    >
    > For now I am thinking of using module - MailClientYahoo-1.0 - but I
    > have not yet looked at it. I am not sure if this is linked to the yahoo
    > US website - or this would work for others also. I would need to take
    > a look at it once I get some time.


    I haven't looked at this, but I would guess it would limit you to Yahoo
    (unless it is very badly misnamed).

    Mark
    Mark Clements, Jan 16, 2006
    #9
  10. Guest

    Re: quoting (was: Re: Win32::OLE Beginner Advice)

    Jürgen Exner wrote:
    > wrote:
    > > How is this related to the Original Post.

    >
    > How is _WHAT_ related to the OP?
    > Please quote an appropriate amount of the article that you are refering
    > to -as has been customary for the past two decades- such that your readers
    > have a chance to understand what you are talking about.
    >

    I am refering to post of Dr. Ruud
    O.O
    , Jan 16, 2006
    #10
    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. M. David Allen

    Win32::OLE, Excel, and coloring

    M. David Allen, Jun 24, 2003, in forum: Perl
    Replies:
    1
    Views:
    5,386
    Jay Tilton
    Jun 25, 2003
  2. Patrick.O.Ige

    Ole ole

    Patrick.O.Ige, Jul 16, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    488
    Patrick.O.Ige
    Jul 16, 2006
  3. Drew Pihera
    Replies:
    0
    Views:
    637
    Drew Pihera
    Feb 4, 2004
  4. Lance Hoffmeyer
    Replies:
    0
    Views:
    238
    Lance Hoffmeyer
    Nov 17, 2003
  5. Sylvia
    Replies:
    4
    Views:
    110
    Sylvia
    Aug 26, 2005
Loading...

Share This Page