Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import win32com.client
- app1 = win32com.client.Dispatch( 'Excel.Application' ) # ok
- app2 = win32com.client.Dispatch( 'Word.Application' ) # ok
- app3 = win32com.client.Dispatch( 'MSDev.Application' ) # error
- >>> import win32com.client
- >>> b = win32com.client.Dispatch('VisualStudio.DTE')
- >>> b
- <COMObject VisualStudio.DTE>
- >>> b.name
- u'Microsoft Visual Studio'
- >>> b.Version
- u'8.0'
- import win32com.client
- oAutoItX = win32com.client.Dispatch( "AutoItX3.Control" )
- oAutoItX.Opt("WinTitleMatchMode", 2) #Match text anywhere in a window title
- width = oAutoItX.WinGetClientSizeWidth("Firefox")
- height = oAutoItX.WinGetClientSizeHeight("Firefox")
- print width, height
- import comtypes.client as client
- vs = client.CreateObject('VisualStudio.DTE')
- commands = [command for command in vs.Commands if bool(command.Name) or bool(command.Bindings)]
- commands.sort(key=lambda cmd : cmd.Name)
- f= open('bindings.csv','w')
- for command in commands:
- f.write(command.Name+"," +";".join(command.Bindings)+ "n")
- f.close()
Add Comment
Please, Sign In to add comment