A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Add-in problem: Process All Marked Header doesn't display email bodies



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old April 1st 10, 06:18 AM posted to microsoft.public.outlook.program_addins
TTT
external usenet poster
 
Posts: 11
Default Add-in problem: Process All Marked Header doesn't display email bodies

Fixed!

if (_explorer.Selection[1] is Outlook.MailItem)

becomes

bool isMailItem = false;

Object objectToInspect = _explorer.Selection[1];

Type type = objectToInspect.GetType();

try
{
if ((Outlook.OlObjectClass)type.InvokeMember("Class", System.Reflection.BindingFlags.GetProperty, null, objectToInspect, null) == Outlook.OlObjectClass.olMail)
{
isMailItem = true;
}
}
catch (Exception ex)
{
//eat
}

if (isMailItem)


Pretty obvious, really


Thanks a lot, Ken


kenslovak wrote on Wed, 31 March 2010 09:05
So try getting the item as an Object and using Reflection to get the Class
property or MessageClass property and examine the item type that way. See if
that causes the same problem as your cast.

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Add-in problem: Process All Marked Header doesn't display email bodies TTT Add-ins for Outlook 2 March 31st 10 01:03 AM
Outlook 2007 Retrieving Message Bodies for Marked Headers Llew Ralph Outlook - General Queries 0 January 1st 10 09:22 AM
message bodies do not display MattG Outlook Express 3 July 6th 07 01:51 AM
message bodies do not display Mark Outlook Express 1 February 9th 06 02:28 AM
OE 6 does not display message bodies Patrick E. King Outlook Express 1 January 27th 06 01:30 AM


All times are GMT +1. The time now is 09:00 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.