PC Review


Reply
Thread Tools Rate Thread

How to avoid the outlook popup warning when retrieving an MailItem

 
 
Michael H
Guest
Posts: n/a
 
      12th Jan 2006
I managed to retrieve an MailItem successfully having the EntryID
ahead of time using:


olApplication = new ApplicationClass();
olNameSpace = this.olApplication.GetNamespace("MAPI");


MailItem item = (MailItem) this.olNameSpace.GetItemFromID(strEntryID,
null);

string retValue = item.Body;



Of course, the Outlook warning window pops up. I've switched to trying
Dmitry Streblechenko's Redemption.DLL but haven't figured out the
exact way to get the MailItem from a known MailItem.EntryID value.

Every single example I have found, so far, deals with "creating" an
EmailItem and then manipulating its fields/properties. This has proven
to be useless so far. I'll keep hacking away at this but don't know
which direction to head next.

Thanks,

Michael
 
Reply With Quote
 
 
 
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      12th Jan 2006
If MailItem is your Outlook mail item:

Dim safMail As Redemption.SafeMailItem

Set safMail = CreateObject("Redemption.SafeMailItem")
safMail.Item = MailItem

Setting safMail.Item assigns the MAPI object for the Outlook MailItem to the
Redemption SafeMailItem you create using CreateObject. From that point you
can access the properties and methods of the Redemption SafeMailitem.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Michael H" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I managed to retrieve an MailItem successfully having the EntryID
> ahead of time using:
>
>
> olApplication = new ApplicationClass();
> olNameSpace = this.olApplication.GetNamespace("MAPI");
>
>
> MailItem item = (MailItem) this.olNameSpace.GetItemFromID(strEntryID,
> null);
>
> string retValue = item.Body;
>
>
>
> Of course, the Outlook warning window pops up. I've switched to trying
> Dmitry Streblechenko's Redemption.DLL but haven't figured out the
> exact way to get the MailItem from a known MailItem.EntryID value.
>
> Every single example I have found, so far, deals with "creating" an
> EmailItem and then manipulating its fields/properties. This has proven
> to be useless so far. I'll keep hacking away at this but don't know
> which direction to head next.
>
> Thanks,
>
> Michael


 
Reply With Quote
 
Michael H
Guest
Posts: n/a
 
      12th Jan 2006
On Thu, 12 Jan 2006 09:45:29 -0500, "Ken Slovak - [MVP - Outlook]"
<(E-Mail Removed)> wrote:

--> If MailItem is your Outlook mail item:
-->
--> Dim safMail As Redemption.SafeMailItem
-->
--> Set safMail = CreateObject("Redemption.SafeMailItem")
--> safMail.Item = MailItem
-->
--> Setting safMail.Item assigns the MAPI object for the Outlook
MailItem to the
--> Redemption SafeMailItem you create using CreateObject. From that
point you
--> can access the properties and methods of the Redemption
SafeMailitem.
-->
--> --
--> Ken Slovak
--> [MVP - Outlook]
--> http://www.slovaktech.com
--> Author: Absolute Beginner's Guide to Microsoft Office Outlook
2003
--> Reminder Manager, Extended Reminders, Attachment Options
--> http://www.slovaktech.com/products.htm


Ken,

Thanks for reply. The whole problem is getting the actual MailItem
object without the popup warning. The only value I have at my disposal
is Email.EntryID value which is returned from Windows Desktop Search.
Currently, I use this value to ask Outlook to return the EmailItem and
voilą the popup!


Michael
 
Reply With Quote
 
Michael H
Guest
Posts: n/a
 
      13th Jan 2006
On Thu, 12 Jan 2006 12:22:32 -0800, Michael H <(E-Mail Removed)>
wrote:

--> Ken,
-->
--> Thanks for reply. The whole problem is getting the actual
MailItem
--> object without the popup warning. The only value I have at my
disposal
--> is Email.EntryID value which is returned from Windows Desktop
Search.
--> Currently, I use this value to ask Outlook to return the
EmailItem and
--> voilą the popup!
-->
-->
--> Michael


I guess the popup warning was occuring on the retrieval of the
MailItem.Body
action and not the
NameSpace.GetItemFromID(strEntryID, null)
call.

So, I just set the SafeMailItem.Item to equal the MailItem returned
from the GetItemFormID and then retrieve the Properties of the Mail
Object and no Outlook Security popups occur.


Thanks,

Michael


 
Reply With Quote
 
Neo
Guest
Posts: n/a
 
      16th Jan 2006
Is "Redemption" provided by Microsoft as part of VSTO?
or is it some 3rd party library? paid or free?

Regards
-Neo

"Ken Slovak - [MVP - Outlook]" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> If MailItem is your Outlook mail item:
>
> Dim safMail As Redemption.SafeMailItem
>
> Set safMail = CreateObject("Redemption.SafeMailItem")
> safMail.Item = MailItem
>
> Setting safMail.Item assigns the MAPI object for the Outlook MailItem to
> the Redemption SafeMailItem you create using CreateObject. From that point
> you can access the properties and methods of the Redemption SafeMailitem.
>
> --
> Ken Slovak
> [MVP - Outlook]
> http://www.slovaktech.com
> Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
> Reminder Manager, Extended Reminders, Attachment Options
> http://www.slovaktech.com/products.htm
>
>
> "Michael H" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>I managed to retrieve an MailItem successfully having the EntryID
>> ahead of time using:
>>
>>
>> olApplication = new ApplicationClass();
>> olNameSpace = this.olApplication.GetNamespace("MAPI");
>>
>>
>> MailItem item = (MailItem) this.olNameSpace.GetItemFromID(strEntryID,
>> null);
>>
>> string retValue = item.Body;
>>
>>
>>
>> Of course, the Outlook warning window pops up. I've switched to trying
>> Dmitry Streblechenko's Redemption.DLL but haven't figured out the
>> exact way to get the MailItem from a known MailItem.EntryID value.
>>
>> Every single example I have found, so far, deals with "creating" an
>> EmailItem and then manipulating its fields/properties. This has proven
>> to be useless so far. I'll keep hacking away at this but don't know
>> which direction to head next.
>>
>> Thanks,
>>
>> Michael

>



 
Reply With Quote
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      16th Jan 2006
Redemption (www.dimastr.com/redemption) is not provided by MS. It is free
for personal use, if you want to redistribute code using Redemption you must
purchase the redistributable version and install it along with your code.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Neo" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Is "Redemption" provided by Microsoft as part of VSTO?
> or is it some 3rd party library? paid or free?
>
> Regards
> -Neo


 
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
How to get MailItem.Body without security warning in Outlook 2010 Tom Microsoft Outlook VBA Programming 2 15th Jan 2010 04:48 PM
Retrieving custom headers from an Outlook (2003) MailItem Andrew Microsoft Outlook Program Addins 1 14th Jan 2009 11:22 PM
Retrieving custom headers from an Outlook MailItem Andrew Microsoft Outlook Program Addins 6 13th Jan 2009 08:31 PM
How to avoid Security PopUp in Outlook 2003 Greg Microsoft Outlook Discussion 1 17th Aug 2006 04:30 PM
how can we avoid security popup in Outlook 2003? =?Utf-8?B?TmFkZWVt?= Microsoft Outlook VBA Programming 6 12th Nov 2005 12:23 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:38 PM.