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

Mark Hammond mhammond at skippinet.com.au
Thu Jul 3 01:21:47 CEST 2008


Attributes will need to be in an instance of the class, not the class itself
(the instance's __dict__ is used).  Also, yu probably want to read up on
registering your classes with "--debugging" so you can see tracebacks and
other details of the implementation.

Cheers,

Mark


> -----Original Message-----
> From: python-win32-bounces at python.org [mailto:python-win32-
> bounces at python.org] On Behalf Of jeff sacksteder
> Sent: Thursday, 3 July 2008 12:56 AM
> To: python-win32 at python.org
> Subject: [python-win32] Implementing Collections / Shim-ing Word
> 
> 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.
> _______________________________________________
> python-win32 mailing list
> python-win32 at python.org
> http://mail.python.org/mailman/listinfo/python-win32



More information about the python-win32 mailing list