ActiveX Automation Examples

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

ActiveX Automation Examples

Barry Carr-2
Hi,

Could anyone point me at any Automation examples. I want to try and drive
MS Word from a small Smalltalk App I've written. Any help appreciated.
Thanks

Barry Carr
Blairgowrie,
Perthshire


Reply | Threaded
Open this post in threaded view
|

Re: ActiveX Automation Examples

Christopher J. Demers
Barry Carr arrakis.clara.net> <barry@<nospam> wrote in message
news:Xns91F9ACD665298barryarrakisclaranet@158.152.254.79...
> Could anyone point me at any Automation examples. I want to try and drive
> MS Word from a small Smalltalk App I've written. Any help appreciated.

In Dolphin 4.0 see the class IDispatch and the class method examples,
particularly  example3 and example4.  To improve performance you may want to
generate the Word classes in Smalltalk.  See the Active-X Component Wizard
under Tools Menu\Additional Tools menu.  Then take a look at the classes it
generates and use those.  The Word VBA documentation will also be useful.

Chris


Reply | Threaded
Open this post in threaded view
|

Re: ActiveX Automation Examples

Barry Carr-2
Hi Chris,

Thanks very much I'll take a look at IDispatch.

I tried the Wizard on the ProdID of Word.Application and it seemed to hang.  
I was wondering if didn't leave it long enough, I left it about 5-10 min
before killing it. Any ideas?

Regards

Barry


Reply | Threaded
Open this post in threaded view
|

Re: ActiveX Automation Examples

Udo Schneider
Barry,

I tried the same for Excel and PowerPoint and I can just tell you that
it might take so long.

The wizard creates a whole bunch of classes not only including word specific
classes but also a lot of general Office classes.

You should try to let in run. AFAIK the wizard writes some info into the
transcript.
So maybe open the Transcript visibly in the background might help.

Udo


"Barry Carr .arrakis.clara" <barry@<nospam>; <net>> schrieb im Newsbeitrag
news:Xns91F9D7E0696BDbarryarrakisclaranet@195.8.68.217...
> Hi Chris,
>
> Thanks very much I'll take a look at IDispatch.
>
> I tried the Wizard on the ProdID of Word.Application and it seemed to
hang.
> I was wondering if didn't leave it long enough, I left it about 5-10 min
> before killing it. Any ideas?
>
> Regards
>
> Barry


Reply | Threaded
Open this post in threaded view
|

Re: ActiveX Automation Examples

Bill Schwab
In reply to this post by Christopher J. Demers
Barry,

> > Could anyone point me at any Automation examples. I want to try and
drive
> > MS Word from a small Smalltalk App I've written. Any help appreciated.
>
> In Dolphin 4.0 see the class IDispatch and the class method examples,
> particularly  example3 and example4.  To improve performance you may want
to
> generate the Word classes in Smalltalk.  See the Active-X Component Wizard
> under Tools Menu\Additional Tools menu.  Then take a look at the classes
it
> generates and use those.  The Word VBA documentation will also be useful.

Ditto to what Chris said :)  For most things that you would do by driving
Word, the actual Automation calls will be a minimal part of the work, so
generating interfaces to make them a more efficient probably isn't going to
buy you much.

Have a good one,

Bill

--
Wilhelm K. Schwab, Ph.D.
[hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: ActiveX Automation Examples

Blair McGlashan
"Bill Schwab" <[hidden email]> wrote in message
news:aa4noq$sjt$[hidden email]...
> ...
> Ditto to what Chris said :)  For most things that you would do by driving
> Word, the actual Automation calls will be a minimal part of the work, so
> generating interfaces to make them a more efficient probably isn't going
to
> buy you much.

Efficiency considerations may indeed not be a concern, but it is much easier
to use a COM object through generated interfaces, not least because it
promotes the COM objects to the status of normal Smalltalk objects so that
one can use the normal references/definitions browsing capabilities. We
recommend that one _always_ generate interfaces. Should this result in a
great deal of bulk, then consider either removing unwanted classes manually,
or just leaving it to the image stripper to do it on application deployment.

Regards

Blair


Reply | Threaded
Open this post in threaded view
|

Re: ActiveX Automation Examples

Bill Schwab
Blair,

> > Ditto to what Chris said :)  For most things that you would do by
driving
> > Word, the actual Automation calls will be a minimal part of the work, so
> > generating interfaces to make them a more efficient probably isn't going
> to
> > buy you much.
>
> Efficiency considerations may indeed not be a concern, but it is much
easier
> to use a COM object through generated interfaces, not least because it
> promotes the COM objects to the status of normal Smalltalk objects so that
> one can use the normal references/definitions browsing capabilities. We
> recommend that one _always_ generate interfaces. Should this result in a
> great deal of bulk, then consider either removing unwanted classes
manually,
> or just leaving it to the image stripper to do it on application
deployment.

I agree when someone (else<g>) does the work of turning the generated
expanse (MS' fault, not yours) into a coherent whole.  An example is your
XML wrapper.  Absent that final polish, I think one is better off making a
wrapper that does a few things using a contained IDispatch pointer.  As the
number of exploited features climibs, generation wins (naturally).

Have a good one,

Bill

--
Wilhelm K. Schwab, Ph.D.
[hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: ActiveX Automation Examples

Barry Carr-2
Gentlemen,

Thank you all for your help and suggestions. I would rather generate the
interfaces for the reasons Blair mentioned. However, I'm having no luck in
generating the interfaces at all. I've tried to generate them on two
different machines now. One I left for nearly five hours! Having a look at
Task Manager tells me that Word is using between 98-99% of the CPU. Surely
it can't take more than several minutes, can it? Both machines are running
Win2K SP2, the latest version of Dolphin and Office 2000 - no service
packs. The machines are no slouches either. One is 1.2GHz athlon with 768mb
of RAM, that other is Sony Vaio notebook PIII 700mhz and 256mb of RAM. Any
further suggestion would be most welcome. Thanks

Regards

Barry

Blairgowrie,
Perthshire


Reply | Threaded
Open this post in threaded view
|

Re: ActiveX Automation Examples

Barry Carr-2
Gentlemen,

A slight case of "Right tent, wrong desert". I was trying to import Word's
typelib via the ActiveX Control browser and not ActiveX control Wizard. Its
amazing how much easier life is when you use the right tool for the job!
Thanks once again for all your help.

Regards

Barry

Blairgowrie,
Perthshire