[IronPython] ironpython as a scripting language for ms office

Carl Trachte ctrachte at gmail.com
Thu Sep 6 22:25:44 CEST 2007


I can't speak with any authority on the Dot Net Framework, but I was
following this thread in the hopes of getting some pointers myself.

I've used Mark Hammond's win32com module for years now and have had great
luck automating Office apps with COM (Microsoft's Component Object Model).
 But, I had previously done the same thing with Visual Basic and VBA within
Office apps, so the transition was easy once I learned how to generate
python modules for the app in question (both Office and other COM enable
apps).  If you generate your own file with pymake (part of the win32
package), you should have access to the same functionality that you would
inside the app (Word, for example) in VBA.

I
commonly open Excel or Word, bring up the VBA editor with the AltF11
combination, and browse the reference libraries for documentation
on the objects I need to write my script in Python.  It's not the most
elegant programming environment, but it works for me.


What little I know about the Dot Net framework suggests that you use a
wrapper type class to COM provided within the framework (I forget the exact
MS terminology).  I don't know if anyone's been doing this from IronPython,
but I would be surprised if someone hadn't at least tried.

I'm using win32com for now, but I'd like to hear more about this too.

My 2 cents.

On 9/6/07, David Jensen <davidjensen at usa.net> wrote:
>
> 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. Does IronPython
> work to fully access ms office apps, like the old vb apparently worked in
> the
> old office (97?). If it does, does this require ms office 2007? (I have
> it)
> I am mostly interested mostly interested in modifying ms access tables.( I
> can
> do this outside access now with standard Python). A lot of people would be
> very pleased if they could use the language of their choice in ms office.
> I
> have vs 2005 standard, apparently I need vs 2005 office ($700) to do this.
> Can't I just run IronPython and forget vs 2005? I started in computers in
> the
> days when everything was command line, and I prefer that environment. Ms
> Office is much more powerful than trying to do things with tkinter or wx.
>
>
> David Jensen
> Apartment 412
> 414 West 120th Street
> New York, New York 10027
> 212-866-7094
> 646-245-2654 (cell)
> 206-984-4900 (fax to email)
> davidjensen at usa.net
>
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20070906/d374a935/attachment.html>


More information about the Ironpython-users mailing list