[python-win32] Problem with python-win32

Tim Roberts timr at probo.com
Fri Aug 25 19:16:53 CEST 2006


Jim Vickroy wrote:

> guillaume.dauguet at mpsa.com wrote:
>
>>
>>Hi,
>>
>>I'm an engineer from France and I use PythonWin very often. I Have one
>>question please : I'd like to run a function from a library included in the
>>"Tools=>COM Browser=>Registered Type Librairies" menu. This library is
>>called "Bibiothèque de pilotage de Scandiag" and I'd like to run from this
>>library the function called "Telechargement" from "ISScandiagOCX".
>>Just below is the source code in Visual basic just as an example so that
>>you can get more easily what I try to explain you :
>>
>>Private Sub CommandButton1_Click()
>>Dim MonObjet As ScandiagOCX
>>Dim result As Integer
>>Set MonObjet = New ScandiagOCX
>>result = MonObjet.Telechargement("C:\Scandiag\Files\edc16.can", 1, 1, 1)
>>Set MonObjet = Nothing
>>End Sub
>>Actually, I'd like to do the same in python.
>>
>>I tried already :
>>
>>import win32com.client
>>ob = win32com.client.Dispatch("The.ProgID")
>>ob.Telechargement()
>>
>>But actually, I don't know which arguments I need to use with the dispatch
>>command.
>>Therefore, what I want you to explain me please is how to determine the
>>"Prog ID". Is it a number, a string??
>>
> Hello Guillaume,
>
> I will tell you what I know (but I am not knowledgeable about this):
>
> The Dispatch parameter is most likely a string.  For example:
>
>     * Dispatch('Excel.Application')
>     * Dispatch('InternetExplorer.Application')
>
> I have no advice to offer on determining what the string is for your
> particular application.


You can see this in the VB application.

  import win32com.client
  ob = win32com.client.Dispatch( "ScandiagOCX" )
  ob.Telechargement( ... )

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the Python-win32 mailing list