PC Review


Reply
Thread Tools Rate Thread

Is it possible to open an Outlook Item from a non-Outlook thread (using OOM) ?

 
 
George Wang
Guest
Posts: n/a
 
      30th Jun 2003
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
 
Reply With Quote
 
 
 
 
Benoit Gantaume
Guest
Posts: n/a
 
      11th Aug 2003
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" <(E-Mail Removed)> a écrit dans le message de
news:(E-Mail Removed)...
> 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



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook 2007 with Vista - "can't open this item. outlook has alrea Steve Microsoft Outlook Discussion 5 25th Jun 2008 05:01 PM
Outlook 2007 " Cannot open this item. cannot open free/busy inform Mahboob Khan Microsoft Outlook Discussion 0 14th Jun 2008 03:14 AM
Opening *.PST file: "Can't open this item. Outlook blocked access to this potentially unsafe item." R2D2 Microsoft Outlook 1 16th Sep 2007 09:14 AM
Opening *.PST file: "Can't open this item. Outlook blocked access to this potentially unsafe item." R2D2 Microsoft Outlook Discussion 1 16th Sep 2007 09:14 AM
can't open this item. Outlook has already begun transmitting this item. Bruce Microsoft Outlook 0 12th Nov 2003 02:07 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:22 AM.