[IronPython] ironpython as a scripting language for ms office

Tim Roberts timr at probo.com
Thu Sep 6 23:36:05 CEST 2007

On Thu, 06 Sep 2007 09:23:00 -0400, "David Jensen" <davidjensen at usa.net>
> I have never used the old visual basic for ms office, so I do not know what it
> is like. I have a (2001?) book on Python for win 32. I have not used the code
> yet, but it says I can use python (2.1?) in, for example, ms word to put text
> into word, but I cannot change  fonts, among other things.

That's not true.  You have the entire object model available to you. 
Once to have the Word application object, you can select text and apply
styles to it.

> Does IronPython work to fully access ms office apps, like the old vb apparently worked in the
> old office (97?).

Just to clarify things, the "old vb" did not work in the "old office". 
Office (even Office 2007) includes a thing called "Visual Basic for
Applications", which is entirely separate from Visual Basic.  VBA is
similar to the old VB, but just different enough to be confusing.

Office still does not use .NET natively, so IronPython won't integrate
any more tightly than C#.  It's all just COM object manipulation, and
that's what you get from CPython as well.

> I am mostly interested mostly interested in modifying ms access tables.( I can
> do this outside access now with standard Python).

And that is still the best way to manipulate Access databases.  The
Access application is a rather crude wrapper around the Jet database
engine, which is completely functional without the Access application.

> A lot of people would be
> very pleased if they could use the language of their choice in ms office.

Maybe some day, but it will take a new and very different version of
Office, and it means all of those existing macros and scripts will have
to be rewritten.

Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.

More information about the Ironpython-users mailing list