Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Win32::OLE Beginner Advice

Reply
Thread Tools

Win32::OLE Beginner Advice

 
 
olson_ord@yahoo.it
Guest
Posts: n/a
 
      01-14-2006
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.

 
Reply With Quote
 
 
 
 
Matt Garrish
Guest
Posts: n/a
 
      01-14-2006

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> 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


 
Reply With Quote
 
 
 
 
olson_ord@yahoo.it
Guest
Posts: n/a
 
      01-15-2006
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.

 
Reply With Quote
 
Mark Clements
Guest
Posts: n/a
 
      01-15-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) 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
 
Reply With Quote
 
Dr.Ruud
Guest
Posts: n/a
 
      01-15-2006
(E-Mail 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/b...y?answer=14213

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


What's good 'netiquette' when posting to Usenet?
http://groups.google.co.uk/support/b...y?answer=12348
http://directory.google.com/Top/Comp...net/Etiquette/

But Google needs you to vote for 'Default quoting of
previous message in replies'
http://groups-beta.google.com/suppor..._type=features

--
Affijn, Ruud

"Gewoon is een tijger."

 
Reply With Quote
 
olson_ord@yahoo.it
Guest
Posts: n/a
 
      01-16-2006
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

 
Reply With Quote
 
olson_ord@yahoo.it
Guest
Posts: n/a
 
      01-16-2006

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.

 
Reply With Quote
 
Jürgen Exner
Guest
Posts: n/a
 
      01-16-2006
(E-Mail Removed) 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


 
Reply With Quote
 
Mark Clements
Guest
Posts: n/a
 
      01-16-2006
(E-Mail Removed) 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
 
Reply With Quote
 
olson_ord@yahoo.it
Guest
Posts: n/a
 
      01-16-2006

Jürgen Exner wrote:
> (E-Mail Removed) 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

 
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
Beginner's Beginner william nelson Ruby 7 04-11-2011 11:23 PM
No Class at ALL!!! beginner/beginner question =?Utf-8?B?S3VydCBTY2hyb2VkZXI=?= ASP .Net 7 02-03-2005 02:47 PM
Beginner Advice Sought jbeck Java 12 09-25-2004 05:48 AM
Tutorial for beginner/ Tutorial voor beginner Rensjuh C++ 7 09-02-2004 12:41 AM
A Beginner needing some advice Edward Doyle Computer Support 2 07-17-2004 03:18 AM



Advertisments