python - Is there anyway to know what object does the file have in MS powerpoint or word -


i use win32com handle office document in python. there no way know method object have in win32com. (in general, can fetch properties or methods dir(obj) in python ) so, if want know properties or methods powerpoint document have , go msdn

however , have powerpoint file contains lots of object. don't know name or type it.

for example ,when want access text in powerpoint can use presentation.slide.textframe.textrange.text access it.

how formula??? if want access it? there anyway when click mouse on object in powerpoint file, , show type of object is?

thanks in advance.

for first question want use makepy utility create early-bound objects can introspect them (ie. press tab , @ methods in ide). cut down searching on msdn 95%

easiest way go pythonwin (installed win32com) , go tools > com makepy utility , select com library want use (in case 'microsoft powerpoint 14.0 object library'). let run , set. described here.

for second question, david pointed out of objects shapes. once run makepy utility able see entire pp object model. quick search helped me find how active shape selected clicking on it.

import win32com.client app = win32com.client.dispatch("powerpoint.application")  selectedshape = app.activewindow.selection.shaperange(1) 

you can play around selectedshape find out need know it.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -