PC Review
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook Program Addins
Is it possible to open an Outlook Item from a non-Outlook thread (using OOM) ?
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook Program Addins
Is it possible to open an Outlook Item from a non-Outlook thread (using OOM) ?
![]() |
Is it possible to open an Outlook Item from a non-Outlook thread (using OOM) ? |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
Hello, there:
I'm implementing an Outlook COM Add-in which captures item open event. Because this guy will do some lengthy thing, so I just save the item EntryID and close it right away. At backend, the Add-in will do its work. After completed, it will use GetItemFromID() get the item and call its Display() method to display it. But after the item shows up, Outlook will crash. === excerpt of pseudo code ====== IDTExtensibility2::OnConnection(..) { // store pointer of Outlook Application } MailItemEvents::Open(..) { // store item Entry ID and store Entry ID // start a UI display progress and a worker thread to the job // close MailItem } ================================= After worker thread completes, UI thread use Outlook Application -> get NameSpace -> GetItemFromID(Entry ID + Store ID). So far no problem. But when call the Item: isplay method, Outlookwill crash. Maybe the item.Display method can only be called from an Outlook thread? Is there a workaround? Thanks! -G |
|
|
|
#2 |
|
Guest
Posts: n/a
|
No!
You can not use OOM from a different thread than the one launched by Outlook! Two solutions: - Create a new object application in your thread (i have not tested) - Change your access method to use Extended MAPI: you can use multi thread. (of course you can mix OOM and MAPI) good luck: we had the same pb. If you have found an other solution, i am curious to know it. ++ "George Wang" <wzhao2000@yahoo.com> a écrit dans le message de news:71620164.0306300850.2a602398@posting.google.com... > Hello, there: > > I'm implementing an Outlook COM Add-in which captures item open event. > Because this guy will do some lengthy thing, so I just save the item > EntryID and close it right away. > > At backend, the Add-in will do its work. After completed, it will use > GetItemFromID() get the item and call its Display() method to display > it. But after the item shows up, Outlook will crash. > > === excerpt of pseudo code ====== > > IDTExtensibility2::OnConnection(..) > { > // store pointer of Outlook Application > } > > MailItemEvents::Open(..) > { > // store item Entry ID and store Entry ID > // start a UI display progress and a worker thread to the job > // close MailItem > } > ================================= > > After worker thread completes, UI thread use Outlook Application -> > get NameSpace -> GetItemFromID(Entry ID + Store ID). > > So far no problem. But when call the Item: isplay method, Outlook> will crash. > > Maybe the item.Display method can only be called from an Outlook > thread? Is there a workaround? > > > Thanks! > > -G |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 
isplay method, Outlook
