I want to be able to script the creation of Excel spreadsheets and
Word documents, interract with Access data bases, and so forth.
Actually, the out-of-date book is still very relevant for most
applications. Chun's book, Core Python Programming also has a section
on using Python to manipulate Office documents.
The docs for PyWin32 currently reside here:
http://aspn.activestate.com/ASPN/docs/ActivePython/2.4/pywin32/win32_modules.html
The com documents specifically can be found here:
http://aspn.activestate.com/ASPN/docs/ActivePython/2.4/pywin32/com.html
As Tim Golden has mentioned before, Pywin32 is bound so closely to the
win32 calls that you can basically just look on MSDN and use the
syntax there in Python, for the most part.
Mike
That book, if you are talking about "Python Programming on Win32" by
Mark Hamond and Andy Robinson, is the best resource that I know of.
There are a few other places for help, and two of those the help files
installed on your computer with win32com and the source code. You may
be able to find other tutorials and such online. What helped me though
was not a better understanding of these packages, but a better
understanding of COM in general. Once I had a fair understanding of
COM I had a much better experience. I found "Inside COM" by Dale
Rogerson to be a good general resource on learning COM, although there
are many books on the subject to choose from. I can't really help you
any more unless you come up with a specific example of what you are
trying to do.
Matt
Colin W.
(Ummm, win32com.client is PART of Mark Hammond's PythonWin, now called
PyWin32.)
--
Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.
Empirically, the best way to do this (for me, at least) is to Google for
examples. There are a few simple rules to learn on how to map the Visual
Basic and C++ COM examples you typically find into Python equivalents. Once
you've seen them once, it becomes pretty natural.
There are a few more esoteric topics (like indexed properties) that require
more exploration, and the pywin32 mailing list is absolutely invaluable for
those occasions.