Kelie schrieb:
> Hello,
> 
> I'm trying to figure out how to process Excel's Application event using
> comtypes. This is what I have so far: 
> 
> import comtypes.client as cc
> xl = cc.GetActiveObject("Excel.Application")
> conn = cc.ShowEvents(xl)
> cc.PumpEvents(30)
> print "Done."
> 
> With the above code, I do see events being listed 
> # event found: AppEvents_WorkbookSync
> # event found: AppEvents_WindowResize
> # event found: AppEvents_WindowActivate
> ...
> 
> But I don't know how to process them. For example, to respond to the
> AppEvents_WorkbookOpen event, I want to just print the workbook name. My guess
> was I need to use the GetEvents function, but don't know how to. Especially 
> the
> sink argument, I don't know what it needs to be. Does anyone have an example? 

I have added an example to the COM events section in the docs:

http://starship.python.net/crew/theller/comtypes/#com-events

and also added a link to the codeproject article.

Thomas


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
comtypes-users mailing list
comtypes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/comtypes-users

Reply via email to