Registering a COM object in Python

Discussion in 'Python' started by Fernando Gabrieli, Oct 30, 2003.

  1. I need to communicate with Outlook 2000 COM object using win32com in Python.

    I registered a new class and called

    win32com.server.register.UseCommandLine(OutlookAddin)

    using this for OutlookAddin

    class OutlookAddin:
    _com_interfaces_ = ['_IDTExtensibility2']
    _public_methods_ = ['alive']
    _reg_clsctx_ = pythoncom.CLSCTX_INPROC_SERVER
    _reg_clsid_ = "{16925498-0E7D-4d7f-A26B-825D994FBCBC}"
    _reg_progid_ = "Test.OutlookAddin"

    Also ive defined OnConnection and other events but they NEVER get called

    Somebody knows what is happening ?

    Thanks,
    Fernando
     
    Fernando Gabrieli, Oct 30, 2003
    #1
    1. Advertising

  2. Hi Fernando,

    do you want to call your python class from outlook, or outlook from your
    python class?

    Greets
    Florian

    "Fernando Gabrieli" <> schrieb im Newsbeitrag
    news:...
    > I need to communicate with Outlook 2000 COM object using win32com in

    Python.
    >
    > I registered a new class and called
    >
    > win32com.server.register.UseCommandLine(OutlookAddin)
    >
    > using this for OutlookAddin
    >
    > class OutlookAddin:
    > _com_interfaces_ = ['_IDTExtensibility2']
    > _public_methods_ = ['alive']
    > _reg_clsctx_ = pythoncom.CLSCTX_INPROC_SERVER
    > _reg_clsid_ = "{16925498-0E7D-4d7f-A26B-825D994FBCBC}"
    > _reg_progid_ = "Test.OutlookAddin"
    >
    > Also ive defined OnConnection and other events but they NEVER get called
    >
    > Somebody knows what is happening ?
    >
    > Thanks,
    > Fernando
     
    Florian Reiser, Oct 31, 2003
    #2
    1. Advertising

  3. I need to call Outlook COM methods from Python

    Thanks for answering :)

    Bye,
    Fernando

    "Florian Reiser" <> wrote in message news:<bnt06n$maa$>...
    > Hi Fernando,
    >
    > do you want to call your python class from outlook, or outlook from your
    > python class?
    >
    > Greets
    > Florian
    >
    > "Fernando Gabrieli" <> schrieb im Newsbeitrag
    > news:...
    > > I need to communicate with Outlook 2000 COM object using win32com in

    > Python.
    > >
    > > I registered a new class and called
    > >
    > > win32com.server.register.UseCommandLine(OutlookAddin)
    > >
    > > using this for OutlookAddin
    > >
    > > class OutlookAddin:
    > > _com_interfaces_ = ['_IDTExtensibility2']
    > > _public_methods_ = ['alive']
    > > _reg_clsctx_ = pythoncom.CLSCTX_INPROC_SERVER
    > > _reg_clsid_ = "{16925498-0E7D-4d7f-A26B-825D994FBCBC}"
    > > _reg_progid_ = "Test.OutlookAddin"
    > >
    > > Also ive defined OnConnection and other events but they NEVER get called
    > >
    > > Somebody knows what is happening ?
    > >
    > > Thanks,
    > > Fernando
     
    Fernando Gabrieli, Oct 31, 2003
    #3
  4. Hi Fernando,

    generate the definition file for Outlook with the gen_py utility.
    After that, try the following code:

    import win32com.client
    outlookObject = win32com.client.Dispatch("Outlook.View")

    then do anything you want on outlookObject. After that release outlookObject
    with del outlookObject.

    Greets
    Florian

    "Fernando Gabrieli" <> schrieb im Newsbeitrag
    news:...
    > I need to call Outlook COM methods from Python
    >
    > Thanks for answering :)
    >
    > Bye,
    > Fernando
    >
    > "Florian Reiser" <> wrote in message

    news:<bnt06n$maa$>...
    > > Hi Fernando,
    > >
    > > do you want to call your python class from outlook, or outlook from your
    > > python class?
    > >
    > > Greets
    > > Florian
    > >
    > > "Fernando Gabrieli" <> schrieb im Newsbeitrag
    > > news:...
    > > > I need to communicate with Outlook 2000 COM object using win32com in

    > > Python.
    > > >
    > > > I registered a new class and called
    > > >
    > > > win32com.server.register.UseCommandLine(OutlookAddin)
    > > >
    > > > using this for OutlookAddin
    > > >
    > > > class OutlookAddin:
    > > > _com_interfaces_ = ['_IDTExtensibility2']
    > > > _public_methods_ = ['alive']
    > > > _reg_clsctx_ = pythoncom.CLSCTX_INPROC_SERVER
    > > > _reg_clsid_ = "{16925498-0E7D-4d7f-A26B-825D994FBCBC}"
    > > > _reg_progid_ = "Test.OutlookAddin"
    > > >
    > > > Also ive defined OnConnection and other events but they NEVER get

    called
    > > >
    > > > Somebody knows what is happening ?
    > > >
    > > > Thanks,
    > > > Fernando
     
    Florian Reiser, Oct 31, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. iksrazal
    Replies:
    0
    Views:
    421
    iksrazal
    Aug 27, 2003
  2. =?Utf-8?B?Q2hhcmxlc0E=?=

    Registering javascript via the Page object, why?

    =?Utf-8?B?Q2hhcmxlc0E=?=, May 15, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    1,421
    Marina Levit [MVP]
    May 15, 2006
  3. Bob Gailer

    Registering Python 2.1.3

    Bob Gailer, Sep 30, 2003, in forum: Python
    Replies:
    0
    Views:
    296
    Bob Gailer
    Sep 30, 2003
  4. tooper
    Replies:
    2
    Views:
    702
    tooper
    Jan 19, 2006
  5. Juan T. Llibre
    Replies:
    2
    Views:
    3,922
    =?Utf-8?B?UmljaA==?=
    Dec 16, 2006
Loading...

Share This Page