Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > OLE Automation of OmniPage 12: Newbie Qs

Reply
Thread Tools

OLE Automation of OmniPage 12: Newbie Qs

 
 
Veli-Pekka Tštilš
Guest
Posts: n/a
 
      07-31-2005
Hi,
This is my first post in this group. Hope it is all right to ask app
specific questions here about OLE, even if Perl is not the culprit. I first
tried the group comp.os.ms-windows.programmer.ole but it is almost dead
compared to this one.

I'm pretty much a newbie as far as OLE and COM goes having only done some
basic automation of SAPI 5 and Auto It from Perl. I own Scansoft
OmniPage 12 and discovered on the Internet that the office version should
support OLE automation. However, I also found out with the help of the
Visual Studio 6 Ole View app that my version 12, which is not the office
edition at all, does seem to have quite a number of methods and properties
that one could use.

Basic methods like AppName and AppInitialized do work. However, I get a
null-reference when trying to do anything useful at all such as create a
document. I found some sample VB code by Googling the news and based on that
tried the following Perl snippet:

use strict;
use OLE;
$/ = "\n";
my $op = CreateObject OLE 'Omnipage12' or die "OLE Error: $!\n";
print "This is " . $op->AppName() . ' v' . $op->Version . "";
my $process = $op->Login('');
warn "App not initialized" unless($op->AppInitialized());
my $result = $process->CreateDocument();
print "Result: $result";

Something definitely does happen when running this. The version and app name
is as expected, the input focus moves temporarily out of the DOS window and
I can hear the hard drive working for a while.

There are two problems, though. Firstly I'm not sure what should be passed
to the login function. No matter what I pass, it never reports that OmniPage
has been initialized succesfully.

The OLE viewre gives the following:

[id(0x00000005), helpstring("Initialize OmniPage for automation")]
IDispatch* Login([in] BSTR Key);

Umm a pointer to the IDispatch interface and a function taking a String name
Key. But what's this bit about the bracketed [in]?

Secondly, perl says that $process has the value undef hinting that something
went wrong early on. I reckon this is a direct consequence of the login
failing but again am not totally sure.

To understand OmniPage OLE automation better I've been trying to find the
official Scansoft docs on it with no luck so far. Neither my version 12
manual nor the version 14 office PDF manual mention OLE automation, oh well.

Has anyone managed to get OmniPage 12 OLE automation working and if so what
am I doing wrong?

Further more, would be great if someone could give a definite answer on
whether OLE Automation is supported in Omni Page version 12 that does not
have the label Office appended to the name. The methods are there as I said
but with my luck they have probably been criplled in some way. If Login
shall always return NULL, for instance, I suppose there's not anything I can
do.

By the way, I'm running Win XP SP2 and Active State Perl 5.8.6 in case that
has any significance.

On a side note, the reason why I'm trying automation in the first place is
that I'd like a quick means of converting a screenshot to speech being sight
impaired. If I could do a little perl script that does the job it might help
a great deal in interpreting textual but image based content quickly without
having to
fall back to full-screen magnification, or manual OCRing for that matter.

Any help greatly appreciated as usual.

--
With kind regards Veli-Pekka Tštilš ((E-Mail Removed))
Accessibility, game music, synthesizers and programming:
http://www.student.oulu.fi/~vtatila/


 
Reply With Quote
 
 
 
 
Sisyphus
Guest
Posts: n/a
 
      07-31-2005

"Veli-Pekka Tštilš" <(E-Mail Removed)> wrote in message
news:dci40u$hrf$(E-Mail Removed)...
> Hi,
> This is my first post in this group. Hope it is all right to ask app
> specific questions here about OLE, even if Perl is not the culprit.


The perl-win32-users mailing hosted by ActiveState is probably a better
forum. (To subscribe, visit http://aspn.activestate.com/ASPN/Mail/ . Mention
"OLE" in the subject line of your post if you send mail there. That will
improve the chances of getting an informed response.)

Beyond that ..... I can't really help - though there may be others here who
can.

Cheers,
Rob


 
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
Question: What is OmniPage Image File (.xif)?? big note Computer Support 2 08-02-2006 07:40 AM
Ole ole Patrick.O.Ige ASP .Net 0 07-16-2006 08:10 AM
Omnipage pro 14/Epson scanner 1250 aretired Computer Support 0 05-22-2005 03:41 AM
OmniPage Pro 14 and HP PSC 1350 Bert Medley Computer Support 1 08-24-2004 05:27 AM
Creating an OLE server document in Python (MFC/OLE/COM/Python newbie) Drew Pihera Python 0 02-04-2004 07:48 PM



Advertisments