Is there a way to do the following?

try:
    import comtypes.gen.Word
except:
    comtypes.client.GetModuleContaining('Word.Application')
    import comtypes.gen.Word

Right now what I am doing is:
word_app = comtypes.client.CreateObject('Word.Application')
import comtypes.gen.Word

But it gives problems if I want to move creation of word_app in a function.

Thanks & Regards,
Suraj


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
comtypes-users mailing list
comtypes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/comtypes-users

Reply via email to