ActiveX Automation Examples 
Author Message
 ActiveX Automation Examples

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



Sat, 09 Oct 2004 23:58:51 GMT  
 ActiveX Automation Examples


Quote:
> 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



Sun, 10 Oct 2004 03:55:22 GMT  
 ActiveX Automation Examples
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



Sun, 10 Oct 2004 05:12:42 GMT  
 ActiveX Automation Examples
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



Quote:
> 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



Sun, 10 Oct 2004 05:03:01 GMT  
 ActiveX Automation Examples
Barry,

Quote:
> > 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.



Sun, 10 Oct 2004 06:37:07 GMT  
 ActiveX Automation Examples

Quote:
> ...
> 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 {*filter*} to do it on application deployment.

Regards

Blair



Sun, 10 Oct 2004 06:52:10 GMT  
 ActiveX Automation Examples
Blair,

Quote:
> > 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 {*filter*} 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.



Sun, 10 Oct 2004 07:27:15 GMT  
 ActiveX Automation Examples
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



Mon, 11 Oct 2004 01:21:04 GMT  
 ActiveX Automation Examples
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



Mon, 11 Oct 2004 09:05:22 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. DocumentShell>>fileSave needs ActiveX Automation

2. How do you implement ActiveX Automation in MVP?

3. Wrapping VA as ActiveX / OCX / OLE Automation

4. ActiveX automation refnum

5. LV5 as ActiveX automation server

6. ActiveX Events from ATL Automation Server?

7. Automation ActiveX for msGraph isnt working

8. Why won't VB ActiveX exe shutdown after using Automation close in Labview

9. Looking for Excel Automation Example Code

10. ActiveX examples needed

11. ActiveX/Optcl examples?

12. Automation Open and Automation Close (Excel)

 

 
Powered by phpBB® Forum Software