Python, COM and scripting Word

Alex Martelli aleax at aleax.it
Thu Aug 9 05:26:06 EDT 2001


"Steve Holden" <sholden at holdenweb.com> wrote in message
news:fRfc7.22129$5j7.1963688 at e420r-atl1.usenetserver.com...
> "Eugene Morozov" <jmv at yandex.ru> wrote in message
> news:87k80fg083.fsf at lucifer.home.spb...
> > Hello!
> > I'm playing with Python, COM and Word and I'm very impressed. It's a
> > shame that no such thing exist under Unix. But I'm actually interested
> > if it is possible to run Python scripts directly from Word, binding
> > them to the toolbar buttons, for example?
> > Eugene
> >
> You could do that indirectly, by implementing COM objects in Python and
then
> creating and manipulating them from VBA. You're having so much fun with
this

A simpler way to 'do that indirectly': from VBA code, instantiate
a "Microsoft Script Control" (downloadable from MS's site if you
don't have it installed), set the Language property to "Python",
and have at it:-).

> stuff you should really get a copy of Hammond and Robinson's "Python
> Programming on Win32" if you haven't already. I assume you haven't yet
> because it explains how to do all this neat stuff in a lot of detail.

Book recommendation seconded, although I don't think they
cover the ScriptControl specifically (a shame, since it's
the easiest way to integrate Python as an application's
scripting language on Win32).


Alex






More information about the Python-list mailing list