embed python in ms-word?

Diez B. Roggisch deets at nospam.web.de
Sat Sep 6 15:06:08 CEST 2008


oyster schrieb:
> in fact, during my work, I often write documnets in ms-word. But the
> doc has many numbers in it, which need to be calculated and to be
> modified frequently.
> 
> Is there a method to write a ms-word add-in, so that
> 1.I can type in the calculation steps in some program language,
> please have a look at http://blender.bokee.com/inc/word_add_in1.jpg
> 
> 2.then the result (here, it is 8) is shown in the doc when I close this window?
> please have a look at http://blender.bokee.com/inc/word_add_in2.jpg
> 
> 3.when I double-click the result 8, I can view/edit the code again
> 
> 4.the code for calculation  is stored in DOC file too, I can change it later
> 
> mathtype equation is a kind of such thing, but only for displaying
> nice equation
> 
> I don't think vba is a good answer, the main reason is: the vba code
> has an incompact link with its result in the documnet

I don't know what you mean with the last sentence - but I still think 
VBA is the answer. There is no other way to write a plugin or some such 
for word than using COM, and VB *is* COM. So whatever you can do in 
Word, it's exposed in VBA. Bringing python into the mixture is just 
creating a lot of hassle.

Automating word with Python is a different thing - that seems to be 
popular and powerful.

Diez



More information about the Python-list mailing list