[python-win32] Implementing Collections / Shim-ing Word

jeff sacksteder jsacksteder at gmail.com
Wed Jul 2 16:56:12 CEST 2008


I have a legacy application that uses Word as printing engine for
standardized forms via COM. I'm trying to develop a thin COM server
shim that implements the minimum required to intercept those requests
and routes them to another application(likely OOo). I had hoped that
the free Word doc viewer implemented a COM server, but no luck.

To do this I need to create a public 'Documents' collection, which I'm
not able to do. The app produces an error saying:

Error Code: Member not found
Subsystem: OLE Automation Client
Error Subcode: 1
Function: DOCUMENTS
Description: Member not Found

(I take that to actually mean a member, not a true function in the 4th line)

The important part of the server is:

class OOoShim:
	_public_methods_ = []
	_public_attrs_ = ['Documents']
	_reg_progid_ = 'Word.Application.8'
	_reg_clsid_ = '{E313D9AC-DE79-4587-971F-A054829819D6}'

	Documents = NewCollection([])

I've tried 'Documents' as an attribute and as a function returning a
collection. This looks like a manageable problem, but I'm stuck on
creating these Collections.


More information about the python-win32 mailing list