Registering a COM object in Python

F

Fernando Gabrieli

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
 
F

Florian Reiser

Hi Fernando,

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

Greets
Florian
 
F

Fernando Gabrieli

I need to call Outlook COM methods from Python

Thanks for answering :)

Bye,
Fernando

Florian Reiser said:
Hi Fernando,

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

Greets
Florian

Fernando Gabrieli said:
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
 
F

Florian Reiser

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 said:
I need to call Outlook COM methods from Python

Thanks for answering :)

Bye,
Fernando

"Florian Reiser" <[email protected]> wrote in message
Hi Fernando,

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

Greets
Florian

Fernando Gabrieli said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top