By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,277 Members | 1,172 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,277 IT Pros & Developers. It's quick & easy.

Registering a COM object in Python

P: n/a
I need to communicate with Outlook 2000 COM object using win32com in Python.

I registered a new class and called

win32com.server.register.UseCommandLine(OutlookAdd in)

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
Jul 18 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi Fernando,

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

Greets
Florian

"Fernando Gabrieli" <fg*******@extrabold.com> schrieb im Newsbeitrag
news:3b**************************@posting.google.c om...
I need to communicate with Outlook 2000 COM object using win32com in Python.
I registered a new class and called

win32com.server.register.UseCommandLine(OutlookAdd in)

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

Jul 18 '05 #2

P: n/a
I need to call Outlook COM methods from Python

Thanks for answering :)

Bye,
Fernando

"Florian Reiser" <fl************@ra-bc.de> wrote in message news:<bn**********@online.de>...
Hi Fernando,

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

Greets
Florian

"Fernando Gabrieli" <fg*******@extrabold.com> schrieb im Newsbeitrag
news:3b**************************@posting.google.c om...
I need to communicate with Outlook 2000 COM object using win32com in

Python.

I registered a new class and called

win32com.server.register.UseCommandLine(OutlookAdd in)

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

Jul 18 '05 #3

P: n/a
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" <fg*******@extrabold.com> schrieb im Newsbeitrag
news:3b*************************@posting.google.co m...
I need to call Outlook COM methods from Python

Thanks for answering :)

Bye,
Fernando

"Florian Reiser" <fl************@ra-bc.de> wrote in message

news:<bn**********@online.de>...
Hi Fernando,

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

Greets
Florian

"Fernando Gabrieli" <fg*******@extrabold.com> schrieb im Newsbeitrag
news:3b**************************@posting.google.c om...
I need to communicate with Outlook 2000 COM object using win32com in

Python.

I registered a new class and called

win32com.server.register.UseCommandLine(OutlookAdd in)

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

Jul 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.