[python-win32] win32com and VS .Net
Johannes Brunen
jbrunen at datasolid.de
Tue Aug 9 09:20:35 CEST 2005
Hi Alex,
thank you for your link. I will take look at it. However, I have already
solved my problem by installing the last pythonCOM package.
It was a bare technically problem.
Below you can see my solution.
With best regards
Johannes
"""Access to the win32com.client.gencache generated type libraries of the MS
.NET 2003 studio.
Usage: import DevEnv.Support
Env = DevEnv.Support.Studio()
"""
__version__ = '1.0'
from win32com.client import gencache
from win32com.client import Dispatch
from win32com.client import constants
class Modules:
def __init__(self):
self.__VStudio =
gencache.EnsureModule('{80CC9F66-E7D8-4DDD-85B6-D9E6CD0E93E2}', 0, 7, 0)
def VStudio(self):
return self.__VStudio
class Studio:
theModules = Modules()
def __init__(self):
self.__EnvDTE = Dispatch("VisualStudio.DTE")
def DTE(self):
return self.__EnvDTE
def main():
"Test of the Support module"
theStudio = Studio()
EnvDTE = theStudio.DTE()
print repr(EnvDTE)
print EnvDTE.Name
theFile = r"langext.dat"
theWindow = EnvDTE.OpenFile(constants.vsViewKindTextView, theFile)
print repr(theWindow)
theWindow.Visible = 1
if __name__ == '__main__':
main()
"Alex Willmer" <alex at moreati.org.uk> schrieb im Newsbeitrag
news:1123546259.7894.1.camel at localhost.localdomain...
> On Mon, 2005-08-08 at 14:23 +0200, Johannes Brunen wrote:
>> Hi,
>>
>> I have the following problem:
>> I would like to control the MS Dev .Net 2003 Studio from a python script,
>> i.e. I would like to open files, add files to projects etc.
>> Has anyone successfully done something like this? Is it possible at all?
>> I tried the makepy.py script on the
>> 'Microsoft Development Environment 7.0 (7.0)' entry (to get a DTE
>> interface), but all what I get is a list of constants.
>> Looking into the OLE/View I did a expect a larger makepy.py generated
>> file output.
>>
>> Any help would be appreciated
>
> It's a few years old, but this might provide some pointers:
>
> http://mail.python.org/pipermail/python-list/2001-December/076881.html
>
> Regards
>
> Alex
More information about the Python-win32
mailing list