Win32::OLE Beginner Advice

O

olson_ord

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.
 
M

Matt Garrish

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
 
O

olson_ord

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.
 
M

Mark Clements

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
 
D

Dr.Ruud

(e-mail address removed) 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
 
O

olson_ord

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
 
O

olson_ord

Mark said:
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.
 
J

Jürgen Exner

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
 
M

Mark Clements

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.
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
 
O

olson_ord

Jürgen Exner said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top