<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sytone&#039;s Ramblings &#187; outlook</title>
	<atom:link href="http://www.sytone.com/tag/outlook/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sytone.com</link>
	<description>Me, Family, Life</description>
	<lastBuildDate>Sun, 05 Sep 2010 07:04:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Getting a Outlook MailItem from a Ribbon Event</title>
		<link>http://www.sytone.com/2010/02/getting-a-outlook-mailitem-from-a-ribbon-event/</link>
		<comments>http://www.sytone.com/2010/02/getting-a-outlook-mailitem-from-a-ribbon-event/#comments</comments>
		<pubDate>Sun, 28 Feb 2010 10:01:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[outlook]]></category>

		<guid isPermaLink="false">http://www.sytone.com/?p=167</guid>
		<description><![CDATA[<p>You may find this code block handy:</p> /// /// Gets the mail item selected in the explorer view if one is selected or instance if that is the view active. /// /// The instance containing the event data. /// A Outlook.MailItem for the mail being viewed. private Outlook.MailItem GetMailItem(RibbonControlEventArgs e) { // Check to see [...]]]></description>
			<content:encoded><![CDATA[<p>You may find this code block handy:</p>
<pre class="brush:csharp">        ///
        /// Gets the mail item selected in the explorer view if one is selected or instance if that is the view active.
        ///
        ///
The  instance containing the event data.
        /// A Outlook.MailItem for the mail being viewed.
        private Outlook.MailItem GetMailItem(RibbonControlEventArgs e)
        {
            // Check to see if a item is select in explorer or we are in inspector.
            if (e.Control.Context is Outlook.Inspector)
            {
                Outlook.Inspector inspector = (Outlook.Inspector)e.Control.Context;

                if (inspector.CurrentItem is Outlook.MailItem)
                {
                    return inspector.CurrentItem as Outlook.MailItem;
                }
            }

            if (e.Control.Context is Outlook.Explorer)
            {
                Outlook.Explorer explorer = (Outlook.Explorer)e.Control.Context;

                Outlook.Selection selectedItems = explorer.Selection;
                if (selectedItems.Count != 1)
                {
                    return null;
                }

                if (selectedItems[1] is Outlook.MailItem)
                {
                    return selectedItems[1] as Outlook.MailItem;
                }
            }

            return null;
        }</pre>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Getting+a+Outlook+MailItem+from+a+Ribbon+Event+-+http://b2l.me/aph8g8&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-comfeed">
			<a href="http://www.sytone.com/2010/02/getting-a-outlook-mailitem-from-a-ribbon-event/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.sytone.com/2010/02/getting-a-outlook-mailitem-from-a-ribbon-event/&amp;title=Getting+a+Outlook+MailItem+from+a+Ribbon+Event" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-digg">
			<a href="http://digg.com/submit?phase=2&amp;url=http://www.sytone.com/2010/02/getting-a-outlook-mailitem-from-a-ribbon-event/&amp;title=Getting+a+Outlook+MailItem+from+a+Ribbon+Event" rel="nofollow" class="external" title="Digg this!">Digg this!</a>
		</li>
		<li class="shr-diigo">
			<a href="http://www.diigo.com/post?url=http://www.sytone.com/2010/02/getting-a-outlook-mailitem-from-a-ribbon-event/&amp;title=Getting+a+Outlook+MailItem+from+a+Ribbon+Event&amp;desc=You%20may%20find%20this%20code%20block%C2%A0handy%3A%0D%0A%20%20%20%20%20%20%20%20%2F%2F%2F%0D%0A%20%20%20%20%20%20%20%20%2F%2F%2F%20Gets%20the%20mail%20item%20selected%20in%20the%20explorer%20view%20if%20one%20is%20selected%20or%20instance%20if%20that%20is%20the%20view%20active.%0D%0A%20%20%20%20%20%20%20%20%2F%2F%2F%0D%0A%20%20%20%20%20%20%20%20%2F%2F%2F%0D%0AThe%20%20instance%20containing%20the%20event%20data.%0D%0A%20%20%20%20%20%20%20%20%2F%2F%2F%20A%20Outlook.MailItem%20for%20the%20mail%20being%20viewed.%0D%0A%20" rel="nofollow" class="external" title="Post this on Diigo">Post this on Diigo</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.sytone.com/2010/02/getting-a-outlook-mailitem-from-a-ribbon-event/&amp;t=Getting+a+Outlook+MailItem+from+a+Ribbon+Event" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-hotmail">
			<a href="http://mail.live.com/?rru=compose?subject=Getting+a+Outlook+MailItem+from+a+Ribbon+Event&amp;body=Link: http://www.sytone.com/2010/02/getting-a-outlook-mailitem-from-a-ribbon-event/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A You%20may%20find%20this%20code%20block%C2%A0handy%3A%0D%0A%20%20%20%20%20%20%20%20%2F%2F%2F%0D%0A%20%20%20%20%20%20%20%20%2F%2F%2F%20Gets%20the%20mail%20item%20selected%20in%20the%20explorer%20view%20if%20one%20is%20selected%20or%20instance%20if%20that%20is%20the%20view%20active.%0D%0A%20%20%20%20%20%20%20%20%2F%2F%2F%0D%0A%20%20%20%20%20%20%20%20%2F%2F%2F%0D%0AThe%20%20instance%20containing%20the%20event%20data.%0D%0A%20%20%20%20%20%20%20%20%2F%2F%2F%20A%20Outlook.MailItem%20for%20the%20mail%20being%20viewed.%0D%0A%20" rel="nofollow" class="external" title="Email this via Hotmail">Email this via Hotmail</a>
		</li>
		<li class="shr-misterwong">
			<a href="http://www.mister-wong.com/addurl/?bm_url=http://www.sytone.com/2010/02/getting-a-outlook-mailitem-from-a-ribbon-event/&amp;bm_description=Getting+a+Outlook+MailItem+from+a+Ribbon+Event&amp;plugin=sexybookmarks" rel="nofollow" class="external" title="Add this to Mister Wong">Add this to Mister Wong</a>
		</li>
		<li class="shr-mixx">
			<a href="http://www.mixx.com/submit?page_url=http://www.sytone.com/2010/02/getting-a-outlook-mailitem-from-a-ribbon-event/&amp;title=Getting+a+Outlook+MailItem+from+a+Ribbon+Event" rel="nofollow" class="external" title="Share this on Mixx">Share this on Mixx</a>
		</li>
		<li class="shr-reddit">
			<a href="http://reddit.com/submit?url=http://www.sytone.com/2010/02/getting-a-outlook-mailitem-from-a-ribbon-event/&amp;title=Getting+a+Outlook+MailItem+from+a+Ribbon+Event" rel="nofollow" class="external" title="Share this on Reddit">Share this on Reddit</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.sytone.com/2010/02/getting-a-outlook-mailitem-from-a-ribbon-event/&amp;title=Getting+a+Outlook+MailItem+from+a+Ribbon+Event" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-technorati">
			<a href="http://technorati.com/faves?add=http://www.sytone.com/2010/02/getting-a-outlook-mailitem-from-a-ribbon-event/" rel="nofollow" class="external" title="Share this on Technorati">Share this on Technorati</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.sytone.com/2010/02/getting-a-outlook-mailitem-from-a-ribbon-event/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Served from: www.sytone.com @ 2010-09-07 00:38:55 by W3 Total Cache -->