<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>mstehle: The CDOs and CDONTS of Messaging Development : Exchange Eventing</title><link>http://blogs.msdn.com/mstehle/archive/tags/Exchange+Eventing/default.aspx</link><description>Tags: Exchange Eventing</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>FYI: Exchange 2007 OnSyncSave Store Events and Plain Text Message Don’t Play Nice</title><link>http://blogs.msdn.com/mstehle/archive/2009/02/05/fyi-exchange-2007-onsyncsave-store-events-and-plain-text-message-don-t-play-nice.aspx</link><pubDate>Fri, 06 Feb 2009 01:54:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9400081</guid><dc:creator>mstehle</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/mstehle/comments/9400081.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mstehle/commentrss.aspx?PostID=9400081</wfw:commentRss><wfw:comment>http://blogs.msdn.com/mstehle/rsscomments.aspx?PostID=9400081</wfw:comment><description>&lt;p&gt;&lt;em&gt;&lt;font size="2" face="Arial"&gt;…Recently, I worked with a customer who was facing the problem described below.&amp;#160; We requested a fix but ended up finding a &lt;/font&gt;&lt;a href="http://blogs.msdn.com/mstehle/archive/2009/01/13/howto-sample-transport-agent-add-headers-categories-mapi-props-even-uses-a-fork.aspx" target="_blank"&gt;&lt;font size="2" face="Arial"&gt;workaround&lt;/font&gt;&lt;/a&gt;&lt;font size="2" face="Arial"&gt; using a Transport Agent.&amp;#160; At this time there is no plan to fix this issue in Exchange 2007…&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;  &lt;h2&gt;&lt;font size="2" face="Arial"&gt;Problem Description&lt;/font&gt;&lt;/h2&gt;  &lt;p&gt;&lt;font size="2" face="Arial"&gt;In an &lt;/font&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa562973.aspx" target="_blank"&gt;&lt;font size="2" face="Arial"&gt;OnSyncSave&lt;/font&gt;&lt;/a&gt;&lt;font size="2" face="Arial"&gt; store event in Exchange 2007 every field's value of a plain text message which triggers the event returns the following exception in the first pre-commit event:&lt;/font&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font size="2" face="Arial"&gt; &amp;quot;Operation failed to complete and the status is unavailable. The field may be unavailable or the operation was not attempted.&amp;quot; &lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;font size="2" face="Arial"&gt;When the &lt;/font&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa562973.aspx" target="_blank"&gt;&lt;font size="2" face="Arial"&gt;OnSyncSave&lt;/font&gt;&lt;/a&gt;&lt;font size="2" face="Arial"&gt; event fires again for this message after the message has been committed to the store the property values can be read.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;font size="2"&gt;&lt;font face="Arial"&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; HTML and RTF messages do not have this problem - this only applies to Plain Text messages.&lt;/font&gt;&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;  &lt;h2&gt;&lt;font size="2" face="Arial"&gt;Workarounds&lt;/font&gt;&lt;/h2&gt;  &lt;p&gt;&lt;font size="2" face="Arial"&gt;There are no straight forward workarounds, only other options which may or may not suit your application’s needs:&lt;/font&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;font size="2" face="Arial"&gt;Use the &lt;/font&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa566475.aspx" target="_blank"&gt;&lt;font size="2" face="Arial"&gt;OnSave&lt;/font&gt;&lt;/a&gt;&lt;font size="2" face="Arial"&gt; asynchronous event sink.&amp;#160; The trade off here is obvious but the OnSave event doesn’t have any problem reading properties from a message that triggers the event.&lt;/font&gt;&lt;/li&gt;    &lt;li&gt;&lt;font size="2" face="Arial"&gt;Use a &lt;/font&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa579185.aspx" target="_blank"&gt;&lt;font size="2" face="Arial"&gt;Transport Agent&lt;/font&gt;&lt;/a&gt;&lt;font size="2" face="Arial"&gt;.&amp;#160; The main trade off here is that transport agents operate outside of the mailbox in the transport stack.&amp;#160; They can’t react to events that happen within a mailbox such as changing an item in the calendar or moving a message from one folder to another.&amp;#160; They only react to mail being delivered to or sent from a mailbox.&lt;/font&gt;&lt;/li&gt;    &lt;li&gt;&lt;font size="2" face="Arial"&gt;Use an &lt;/font&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb226710.aspx" target="_blank"&gt;&lt;font size="2" face="Arial"&gt;Outlook Add-in&lt;/font&gt;&lt;/a&gt;&lt;font size="2" face="Arial"&gt;.&amp;#160; The big trade-off here is that changes in OWA are not handled, you can only react to events that the user triggers in Outlook.&lt;/font&gt;&lt;/li&gt;    &lt;li&gt;&lt;font size="2" face="Arial"&gt;Use &lt;/font&gt;&lt;a href="http://office.microsoft.com/en-us/outlook/HA100968031033.aspx?pid=CH101032711033" target="_blank"&gt;&lt;font size="2" face="Arial"&gt;rules&lt;/font&gt;&lt;/a&gt;&lt;font size="2" face="Arial"&gt;.&amp;#160; The main drawback is that they have a fixed set of functions but they don’t require any code to be written or bits to be deployed.&lt;/font&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;font size="2" face="Arial"&gt;Again, depending on your solution one of these workarounds or combination of two might accomplish what you need.&amp;#160; An example of combining two of these options would be to use a transport agent to tag messages as they are sent to a particular mailbox and then use a rule to key off this tag and move those messages to a specific folder on deliver.&lt;/font&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9400081" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mstehle/archive/tags/FYI/default.aspx">FYI</category><category domain="http://blogs.msdn.com/mstehle/archive/tags/Exchange+Eventing/default.aspx">Exchange Eventing</category><category domain="http://blogs.msdn.com/mstehle/archive/tags/DevMsgTeam/default.aspx">DevMsgTeam</category></item><item><title>HOWTO: Sample Transport Agent – Add Headers, Categories, MAPI Props, Even Uses a Fork!</title><link>http://blogs.msdn.com/mstehle/archive/2009/01/13/howto-sample-transport-agent-add-headers-categories-mapi-props-even-uses-a-fork.aspx</link><pubDate>Wed, 14 Jan 2009 00:50:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9317264</guid><dc:creator>mstehle</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/mstehle/comments/9317264.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mstehle/commentrss.aspx?PostID=9317264</wfw:commentRss><wfw:comment>http://blogs.msdn.com/mstehle/rsscomments.aspx?PostID=9317264</wfw:comment><description>&lt;p&gt;&lt;span style="color: blue"&gt;&lt;font color="#000000" size="2" face="Arial"&gt;Welcome to my first in depth Exchange Transport Agent sample!&amp;#160; If you are not familiar with Exchange Transport Agents &lt;a href="http://msexchangeteam.com/archive/2006/12/04/431755.aspx"&gt;this&lt;/a&gt; blog post is a great place to start.&amp;#160; I created a sample Transport Agent for a customer a while ago that I recently added commenting to and cleaned up so it could serve as a general demo &lt;/font&gt;&lt;/span&gt;&lt;span style="color: blue"&gt;&lt;font color="#000000" size="2" face="Arial"&gt;suitable for this blog. The focus of this sample is to illustrate a several techniques but no necessarily serve as a template or best practice for writing transport agents in general.&amp;#160; The key techniques illustrated are:&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;&lt;span style="color: blue"&gt;&lt;font color="#000000" size="2" face="Arial"&gt;Forking a message in the “OnSubmittedMessage” event to process a messages individually for each recipient.&lt;/font&gt;&lt;/span&gt;&lt;/li&gt;    &lt;li&gt;&lt;span style="color: blue"&gt;&lt;font color="#000000" size="2" face="Arial"&gt;Adding a custom header to a message.&lt;/font&gt;&lt;/span&gt;&lt;/li&gt;    &lt;li&gt;&lt;span style="color: blue"&gt;&lt;font color="#000000" size="2" face="Arial"&gt;Adding a Keywords (also known as Category) header to a message&lt;/font&gt;&lt;/span&gt;&lt;/li&gt;    &lt;li&gt;&lt;span style="color: blue"&gt;&lt;font color="#000000" size="2" face="Arial"&gt;Adding a custom named property to a MAPI message&lt;/font&gt;&lt;/span&gt;&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&lt;span style="color: blue"&gt;&lt;font color="#000000" size="2" face="Arial"&gt;The comments in the code speak for themselves so I won’t walk through it all.&amp;#160; There are two very important notes regarding the Keyword header and adding MAPI properties that I want to emphasize though.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="color: blue"&gt;&lt;strong&gt;&lt;font color="#000000" size="2" face="Arial"&gt;The Keywords Header is Removed By Default&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="color: blue"&gt;&lt;font color="#000000" size="2" face="Arial"&gt;If you are you trying to add the Keywords header in a transport agent or even just when sending MIME messages to Exchange 2007 keep in mind that this header is translated into Categories which are removed by default during content conversion.&amp;#160; If you really need this functionality though, you can turn this off using the Set-TransportConfig cmdlet and setting ClearCategories to $false.&amp;#160; Click &lt;a href="http://technet.microsoft.com/en-us/library/bb124151.aspx"&gt;here&lt;/a&gt; to read more.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="color: blue"&gt;&lt;strong&gt;&lt;font color="#000000" size="2" face="Arial"&gt;If You Don’t Get TNEF, You Don’t Have TNEF&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="color: blue"&gt;&lt;font color="#000000" size="2" face="Arial"&gt;There is no API to convert MIME messages to TNEF within a transport agent.&amp;#160; The TNEF body part must be a full representation of the message being submitted to Exchange.&amp;#160; You can’t have a complex MIME message with a TNEF body part that simply adds a MAPI property or two.&amp;#160; Messages that are submitted from outside the organization will mostly like not have TNEF, there is no mechanism to create a representative TNEF body part for these messages and then append properties.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="color: blue"&gt;&lt;font color="#000000" size="2" face="Arial"&gt;One final note is that this sample logs information out to a text file on the system.&amp;#160; Keep in mind that transport agents run in the context of the Exchange Transport Service which is typically Network Service.&amp;#160; In this case, the Network Service account would need write permissions to whatever folder the log file is configured to write to.&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="color: blue"&gt;&lt;font color="#000000" size="2" face="Arial"&gt;Enjoy…&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;ol&gt;   &lt;p&gt;&lt;span style="color: blue"&gt;&lt;font color="#000000" size="2" face="Arial"&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;/ol&gt;  &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;using &lt;/span&gt;System;
&lt;span style="color: blue"&gt;using &lt;/span&gt;System.Collections.Generic;
&lt;span style="color: blue"&gt;using &lt;/span&gt;System.Text;
&lt;span style="color: blue"&gt;using &lt;/span&gt;System.IO;
&lt;span style="color: blue"&gt;using &lt;/span&gt;Microsoft.Exchange.Data.Transport;
&lt;span style="color: blue"&gt;using &lt;/span&gt;Microsoft.Exchange.Data.Transport.Routing;
&lt;span style="color: blue"&gt;using &lt;/span&gt;Microsoft.Exchange.Data.Common;
&lt;span style="color: blue"&gt;using &lt;/span&gt;Microsoft.Exchange.Data.Mime;
&lt;span style="color: blue"&gt;using &lt;/span&gt;Microsoft.Exchange.Data.ContentTypes.Tnef;

&lt;span style="color: blue"&gt;namespace &lt;/span&gt;MyRoutingAgent
{

    &lt;span style="color: blue"&gt;public sealed class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;MyRoutingAgentFactory &lt;/span&gt;: &lt;span style="color: #2b91af"&gt;RoutingAgentFactory
    &lt;/span&gt;{
        &lt;span style="color: blue"&gt;public override &lt;/span&gt;&lt;span style="color: #2b91af"&gt;RoutingAgent &lt;/span&gt;CreateAgent(&lt;span style="color: #2b91af"&gt;SmtpServer &lt;/span&gt;server)
        {
            &lt;span style="color: blue"&gt;return new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;MyRoutingAgent&lt;/span&gt;();
        }
    }

    &lt;span style="color: blue"&gt;public class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;MyRoutingAgent &lt;/span&gt;: &lt;span style="color: #2b91af"&gt;RoutingAgent
    &lt;/span&gt;{
        &lt;span style="color: green"&gt;// Place this text in the subject to test the agent
        &lt;/span&gt;&lt;span style="color: blue"&gt;public const string &lt;/span&gt;TEST_TOKEN = &lt;span style="color: #a31515"&gt;&amp;quot;[TEST]&amp;quot;&lt;/span&gt;;
        &lt;span style="color: blue"&gt;public const string &lt;/span&gt;LOG_FILE_PATH = &lt;span style="color: #a31515"&gt;@&amp;quot;C:\Users\Administrator\Desktop\MyRoutingAgent\MyRoutingAgent.log&amp;quot;&lt;/span&gt;;

        &lt;span style="color: blue"&gt;public &lt;/span&gt;MyRoutingAgent()
        {
            &lt;span style="color: blue"&gt;this&lt;/span&gt;.OnRoutedMessage += &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;RoutedMessageEventHandler&lt;/span&gt;(MyRoutingAgent_OnRoutedMessage);
            &lt;span style="color: blue"&gt;this&lt;/span&gt;.OnSubmittedMessage += &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;SubmittedMessageEventHandler&lt;/span&gt;(MyRoutingAgent_OnSubmittedMessage);
            &lt;span style="color: blue"&gt;this&lt;/span&gt;.OnResolvedMessage += &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ResolvedMessageEventHandler&lt;/span&gt;(MyRoutingAgent_OnResolvedMessage);
        }

        &lt;span style="color: blue"&gt;void &lt;/span&gt;MyRoutingAgent_OnSubmittedMessage(&lt;span style="color: #2b91af"&gt;SubmittedMessageEventSource &lt;/span&gt;source, &lt;span style="color: #2b91af"&gt;QueuedMessageEventArgs &lt;/span&gt;e)
        {
            &lt;span style="color: green"&gt;// Don't process EVERY message...
            &lt;/span&gt;&lt;span style="color: blue"&gt;if &lt;/span&gt;(e.MailItem.Message.Subject.Contains(TEST_TOKEN))
            {
                &lt;span style="color: green"&gt;// If we have multiple recipients, fork the message to process each recipient seperately...
                &lt;/span&gt;&lt;span style="color: blue"&gt;if &lt;/span&gt;(e.MailItem.Recipients.Count &amp;gt; 1)
                {
                    LogMessage(&lt;span style="color: #a31515"&gt;&amp;quot;OnSubmittedMessage&amp;quot;&lt;/span&gt;, e.MailItem, &lt;span style="color: #a31515"&gt;&amp;quot;Forking message with &amp;quot; &lt;/span&gt;+ e.MailItem.Recipients.Count + &lt;span style="color: #a31515"&gt;&amp;quot; recipients.&amp;quot;&lt;/span&gt;);

                    &lt;span style="color: blue"&gt;int &lt;/span&gt;count = 0;
                    &lt;span style="color: blue"&gt;while &lt;/span&gt;(e.MailItem.Recipients.Count &amp;gt; 1)
                    {
                        &lt;span style="color: green"&gt;// Create an individual forked message for each recipient...
                        &lt;/span&gt;&lt;span style="color: #2b91af"&gt;EnvelopeRecipient &lt;/span&gt;recip = e.MailItem.Recipients[e.MailItem.Recipients.Count - 1];
                        &lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af"&gt;EnvelopeRecipient&lt;/span&gt;&amp;gt; recips = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af"&gt;EnvelopeRecipient&lt;/span&gt;&amp;gt;();
                        recips.Add(recip);
                        source.Fork(recips);
                        count++;
                    }

                    &lt;span style="color: green"&gt;// This should always be one.
                    &lt;/span&gt;LogMessage(&lt;span style="color: #a31515"&gt;&amp;quot;OnSubmittedMessage&amp;quot;&lt;/span&gt;, e.MailItem, &lt;span style="color: #a31515"&gt;&amp;quot;Forked &amp;quot; &lt;/span&gt;+ count + &lt;span style="color: #a31515"&gt;&amp;quot; messages.&amp;quot;&lt;/span&gt;);
                }
                &lt;span style="color: blue"&gt;else
                &lt;/span&gt;{
                    LogMessage(&lt;span style="color: #a31515"&gt;&amp;quot;OnSubmittedMessage&amp;quot;&lt;/span&gt;, e.MailItem, &lt;span style="color: #a31515"&gt;&amp;quot;Single recipient, no forking needed.&amp;quot;&lt;/span&gt;);
                }
            }
        }

        &lt;span style="color: blue"&gt;void &lt;/span&gt;MyRoutingAgent_OnResolvedMessage(&lt;span style="color: #2b91af"&gt;ResolvedMessageEventSource &lt;/span&gt;source, &lt;span style="color: #2b91af"&gt;QueuedMessageEventArgs &lt;/span&gt;e)
        {
            &lt;span style="color: green"&gt;// Don't process EVERY message...
            &lt;/span&gt;&lt;span style="color: blue"&gt;if &lt;/span&gt;(e.MailItem.Message.Subject.Contains(TEST_TOKEN))
            {
                &lt;span style="color: #2b91af"&gt;MimePart &lt;/span&gt;tnefPart = e.MailItem.Message.TnefPart;
                &lt;span style="color: blue"&gt;if &lt;/span&gt;(tnefPart != &lt;span style="color: blue"&gt;null&lt;/span&gt;)
                {
                    LogMessage(&lt;span style="color: #a31515"&gt;&amp;quot;OnResolvedMessage&amp;quot;&lt;/span&gt;, e.MailItem, &lt;span style="color: #a31515"&gt;&amp;quot;TNEF&amp;quot;&lt;/span&gt;);
                }
                &lt;span style="color: blue"&gt;else
                &lt;/span&gt;{
                    LogMessage(&lt;span style="color: #a31515"&gt;&amp;quot;OnResolvedMessage&amp;quot;&lt;/span&gt;, e.MailItem, &lt;span style="color: #a31515"&gt;&amp;quot;No TNEF&amp;quot;&lt;/span&gt;);
                }
            }
        }
        
        &lt;span style="color: blue"&gt;void &lt;/span&gt;MyRoutingAgent_OnRoutedMessage(&lt;span style="color: #2b91af"&gt;RoutedMessageEventSource &lt;/span&gt;source, &lt;span style="color: #2b91af"&gt;QueuedMessageEventArgs &lt;/span&gt;e)
        {
            &lt;span style="color: green"&gt;// Don't process EVERY message...
            &lt;/span&gt;&lt;span style="color: blue"&gt;if &lt;/span&gt;(e.MailItem.Message.Subject.Contains(TEST_TOKEN))
            {
                &lt;span style="color: blue"&gt;if &lt;/span&gt;(e.MailItem.Recipients.Count == 1)
                {
                    LogMessage(&lt;span style="color: #a31515"&gt;&amp;quot;OnRoutedMessage&amp;quot;&lt;/span&gt;, e.MailItem, &lt;span style="color: #a31515"&gt;&amp;quot;Processing message sent to &amp;quot; &lt;/span&gt;+ e.MailItem.Recipients[0].Address.LocalPart + &lt;span style="color: #a31515"&gt;&amp;quot;.&amp;quot;&lt;/span&gt;);

                    &lt;span style="color: green"&gt;// If we haven't already processed this message...
                    &lt;/span&gt;&lt;span style="color: blue"&gt;if &lt;/span&gt;(e.MailItem.Message.MimeDocument.RootPart.Headers.FindFirst(&lt;span style="color: #a31515"&gt;&amp;quot;MyHeader&amp;quot;&lt;/span&gt;) == &lt;span style="color: blue"&gt;null&lt;/span&gt;)
                    {
                        ProcessMailItem(e.MailItem);
                    }
                    &lt;span style="color: blue"&gt;else
                    &lt;/span&gt;{
                        LogMessage(&lt;span style="color: #a31515"&gt;&amp;quot;OnRoutedMessage&amp;quot;&lt;/span&gt;, e.MailItem, &lt;span style="color: #a31515"&gt;&amp;quot;Already processed this message, skipping.&amp;quot;&lt;/span&gt;);
                    }
                }
                &lt;span style="color: blue"&gt;else
                &lt;/span&gt;{
                    LogMessage(&lt;span style="color: #a31515"&gt;&amp;quot;OnRoutedMessage&amp;quot;&lt;/span&gt;, e.MailItem, &lt;span style="color: #a31515"&gt;&amp;quot;Unexpected number of recipients, &amp;quot; &lt;/span&gt;+ e.MailItem.Recipients.Count.ToString() + &lt;span style="color: #a31515"&gt;&amp;quot;.&amp;quot;&lt;/span&gt;);
                }
            }
        }

        &lt;span style="color: gray"&gt;/// &amp;lt;summary&amp;gt;
        /// &lt;/span&gt;&lt;span style="color: green"&gt;Add a custom header, keyword header, and MAPI
        &lt;/span&gt;&lt;span style="color: gray"&gt;/// &lt;/span&gt;&lt;span style="color: green"&gt;named property into PS_PUBLIC_STRINGS if there
        &lt;/span&gt;&lt;span style="color: gray"&gt;/// &lt;/span&gt;&lt;span style="color: green"&gt;is a TNEF body part.
        &lt;/span&gt;&lt;span style="color: gray"&gt;/// &amp;lt;/summary&amp;gt;
        &lt;/span&gt;&lt;span style="color: blue"&gt;private void &lt;/span&gt;ProcessMailItem(&lt;span style="color: #2b91af"&gt;MailItem &lt;/span&gt;item)
        {
            &lt;span style="color: green"&gt;// Modify the subject of this message to ensure the
            // fork worked.  Append the first recipient name to the 
            // subject.  This should match the mailbox name the
            // message is delivered to.
            &lt;/span&gt;item.Message.Subject = item.Message.Subject + &lt;span style="color: #a31515"&gt;&amp;quot;| To: &amp;quot; &lt;/span&gt;+ item.Recipients[0].Address.LocalPart;

            &lt;span style="color: #2b91af"&gt;MimeDocument &lt;/span&gt;mdMimeDoc = item.Message.MimeDocument;
            &lt;span style="color: #2b91af"&gt;HeaderList &lt;/span&gt;hlHeaderlist = mdMimeDoc.RootPart.Headers;
            &lt;span style="color: #2b91af"&gt;MimeNode &lt;/span&gt;lhLasterHeader = hlHeaderlist.LastChild;

            &lt;span style="color: green"&gt;// Add a custom header
            &lt;/span&gt;&lt;span style="color: #2b91af"&gt;TextHeader &lt;/span&gt;nhNewHeader = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;TextHeader&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;MyHeader&amp;quot;&lt;/span&gt;, &lt;span style="color: #a31515"&gt;&amp;quot;MyHeaderValue&amp;quot;&lt;/span&gt;);
            hlHeaderlist.InsertBefore(nhNewHeader, lhLasterHeader);

            &lt;span style="color: green"&gt;// Add the Keywords header to set a Category in Outlook/OWA.
            // *** INFO ***
            // Keywords (also known as Categories) are stripped from
            // message by default.  This can be disabled using the 
            // &amp;quot;Set-TransportConfig –ClearCategories $false&amp;quot; cmdlet.
            // (http://technet.microsoft.com/en-us/library/bb124151.aspx)
            &lt;/span&gt;&lt;span style="color: #2b91af"&gt;TextHeader &lt;/span&gt;nhNewKeywords = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;TextHeader&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;Keywords&amp;quot;&lt;/span&gt;, &lt;span style="color: #a31515"&gt;&amp;quot;1&amp;quot;&lt;/span&gt;);
            hlHeaderlist.InsertBefore(nhNewKeywords, lhLasterHeader);

            &lt;span style="color: #2b91af"&gt;MimePart &lt;/span&gt;tnefPart = item.Message.TnefPart;

            &lt;span style="color: green"&gt;// Without a TNEF body part, we can't do this step.
            // There is no way to create a TNEF body part from
            // scratch if Exchange isn't giving us one.  Most
            // mail that comes from the internet won't have TNEF.
            &lt;/span&gt;&lt;span style="color: blue"&gt;if &lt;/span&gt;(tnefPart != &lt;span style="color: blue"&gt;null&lt;/span&gt;)
            {
                &lt;span style="color: #2b91af"&gt;TnefReader &lt;/span&gt;reader = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;TnefReader&lt;/span&gt;(tnefPart.GetContentReadStream());
                &lt;span style="color: #2b91af"&gt;TnefWriter &lt;/span&gt;writer = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;TnefWriter&lt;/span&gt;(
                    tnefPart.GetContentWriteStream(tnefPart.ContentTransferEncoding),
                    reader.AttachmentKey,
                    0,
                    &lt;span style="color: #2b91af"&gt;TnefWriterFlags&lt;/span&gt;.NoStandardAttributes);

                &lt;span style="color: blue"&gt;while &lt;/span&gt;(reader.ReadNextAttribute())
                {
                    &lt;span style="color: blue"&gt;if &lt;/span&gt;(reader.AttributeTag == &lt;span style="color: #2b91af"&gt;TnefAttributeTag&lt;/span&gt;.MapiProperties)
                    {
                        writer.StartAttribute(&lt;span style="color: #2b91af"&gt;TnefAttributeTag&lt;/span&gt;.MapiProperties, &lt;span style="color: #2b91af"&gt;TnefAttributeLevel&lt;/span&gt;.Message);
                        writer.WriteAllProperties(reader.PropertyReader);

                        &lt;span style="color: blue"&gt;int &lt;/span&gt;tag;
                        &lt;span style="color: blue"&gt;unchecked
                        &lt;/span&gt;{
                            &lt;span style="color: green"&gt;// The first four bytes of the tag is must be at least 0x8000 
                            // when setting a named property, the second determines the type. 
                            // http://www.cdolive.com/cdo10.htm
                            &lt;/span&gt;tag = (&lt;span style="color: blue"&gt;int&lt;/span&gt;)0x8000001E;
                        }

                        &lt;span style="color: #2b91af"&gt;Guid &lt;/span&gt;PS_PUBLIC_STRINGS = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Guid&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;00020329-0000-0000-C000-000000000046&amp;quot;&lt;/span&gt;);

                        writer.StartProperty(
                            &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;TnefPropertyTag&lt;/span&gt;(tag),
                            PS_PUBLIC_STRINGS,
                            &lt;span style="color: #a31515"&gt;&amp;quot;MyProp&amp;quot;&lt;/span&gt;);
                        writer.WritePropertyValue(&lt;span style="color: #a31515"&gt;&amp;quot;Hello!&amp;quot;&lt;/span&gt;);
                    }
                    &lt;span style="color: blue"&gt;else
                    &lt;/span&gt;{
                        writer.WriteAttribute(reader);
                    }
                }

                &lt;span style="color: green"&gt;//  Close writer
                &lt;/span&gt;&lt;span style="color: blue"&gt;if &lt;/span&gt;(&lt;span style="color: blue"&gt;null &lt;/span&gt;!= writer)
                {
                    writer.Close();
                }

                LogMessage(&lt;span style="color: #a31515"&gt;&amp;quot;ProcessMailItem&amp;quot;&lt;/span&gt;, item, &lt;span style="color: #a31515"&gt;&amp;quot;Added 'MyProp' to PS_PUBLIC_STRINGS.&amp;quot;&lt;/span&gt;);
            }
            &lt;span style="color: blue"&gt;else
            &lt;/span&gt;{
                LogMessage(&lt;span style="color: #a31515"&gt;&amp;quot;ProcessMailItem&amp;quot;&lt;/span&gt;, item, &lt;span style="color: #a31515"&gt;&amp;quot;No TNEF, not adding property&amp;quot;&lt;/span&gt;);
            }
        }

        &lt;span style="color: blue"&gt;private void &lt;/span&gt;LogMessage(&lt;span style="color: blue"&gt;string &lt;/span&gt;eventName, &lt;span style="color: #2b91af"&gt;MailItem &lt;/span&gt;item, &lt;span style="color: blue"&gt;string &lt;/span&gt;message)
        {
            &lt;span style="color: #2b91af"&gt;TextWriter &lt;/span&gt;tw = System.IO.&lt;span style="color: #2b91af"&gt;File&lt;/span&gt;.AppendText(LOG_FILE_PATH);
            tw.WriteLine(&lt;span style="color: #2b91af"&gt;DateTime&lt;/span&gt;.Now.Ticks + &lt;span style="color: #a31515"&gt;&amp;quot;\t&amp;quot; &lt;/span&gt;+ eventName + &lt;span style="color: #a31515"&gt;&amp;quot; - &amp;quot; &lt;/span&gt;+ item.Message.Subject + &lt;span style="color: #a31515"&gt;&amp;quot; - &amp;quot; &lt;/span&gt;+ message);
            tw.Close();
        }
    }

}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9317264" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mstehle/archive/tags/HOWTO/default.aspx">HOWTO</category><category domain="http://blogs.msdn.com/mstehle/archive/tags/Exchange+Eventing/default.aspx">Exchange Eventing</category><category domain="http://blogs.msdn.com/mstehle/archive/tags/DevMsgTeam/default.aspx">DevMsgTeam</category><category domain="http://blogs.msdn.com/mstehle/archive/tags/Transport+Agents/default.aspx">Transport Agents</category></item><item><title>TalkBack: Synchronous Event Processing In Your Custom Applications</title><link>http://blogs.msdn.com/mstehle/archive/2008/09/30/talkback-synchronous-event-processing-in-your-custom-applications.aspx</link><pubDate>Tue, 30 Sep 2008 18:14:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8970381</guid><dc:creator>mstehle</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/mstehle/comments/8970381.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mstehle/commentrss.aspx?PostID=8970381</wfw:commentRss><wfw:comment>http://blogs.msdn.com/mstehle/rsscomments.aspx?PostID=8970381</wfw:comment><description>&lt;p&gt;&lt;font face="Arial" size="2"&gt;The Exchange Developer blog has a &lt;a href="http://blogs.msdn.com/exchangedev/archive/2008/05/22/exchange-developer-roadmap.aspx" target="_blank"&gt;post&lt;/a&gt;&amp;#160;&lt;/font&gt;&lt;font face="Arial" size="2"&gt;updating the future vision of Exchange development.&amp;#160; If you remember, there was a &lt;a href="http://msexchangeteam.com/archive/2005/09/15/410941.aspx" target="_blank"&gt;post&lt;/a&gt;&lt;/font&gt;&lt;font face="Arial" size="2"&gt; on the Exchange Team blog back in September 2005 that gave us the first glimpse of this vision leading up to Exchange 2007.&amp;#160; The vision has come into focus some more but the overall direction hasn't changed in the two and a half years since the first Exchange 12 roadmap post.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Arial" size="2"&gt;Here are the important notes from the roadmap…&lt;/font&gt;&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;&lt;font face="Arial" size="2"&gt;Exchange Web Services are the API of choice in Exchange 2007 and beyond for mailbox and public folder access.&lt;/font&gt;&lt;/li&gt;    &lt;li&gt;&lt;font face="Arial" size="2"&gt;The web store APIs (WebDAV, CDOEX, and Store Events) which are de-emphasized in Exchange 2007 will be going away in the next release.&lt;/font&gt;&lt;/li&gt;    &lt;li&gt;&lt;font face="Arial" size="2"&gt;The MAPI and CDO 1.21 download will be aligned with the lifecycle of Exchange 2003, meaning they will be moving to extended support in the near future.&lt;/font&gt;&lt;/li&gt;    &lt;li&gt;&lt;em&gt;&lt;font face="Arial" size="2"&gt;Since at this point store event sinks will be gone in the next version of Exchange, synchronous event processing with OnSyncSave and OnSyncDelete will not be possible.&lt;/font&gt;&lt;/em&gt;&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&lt;em&gt;&lt;strong&gt;&lt;font face="Arial" size="2"&gt;We’d like to hear from you about the last point…&lt;/font&gt;&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Arial" size="2"&gt;I am working with the product team to discuss any scenarios where EWS notifications and Transport Agents might not be sufficient to replace synchronous store event processing in a custom solution.&amp;#160; The Exchange development team and my Exchange support team are aware of the potential challenges arising from changing the development interfaces available.&amp;#160; Between Exchange Web Services notifications and Transport Agents we feel that we can fill a lot of the gaps left by removing synchronous store event processing but we want to hear from you.&amp;#160; &lt;strong&gt;Are there scenarios that you currently require synchronous event processing for right now?&lt;/strong&gt;&amp;#160; &lt;strong&gt;Please email me or leave a comment describing your scenario. &lt;/strong&gt; Getting your feedback will help us prepare documentation, workarounds, or solutions that can mitigate the challenges presented by this change.&lt;/font&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8970381" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mstehle/archive/tags/Exchange+Eventing/default.aspx">Exchange Eventing</category><category domain="http://blogs.msdn.com/mstehle/archive/tags/DevMsgTeam/default.aspx">DevMsgTeam</category><category domain="http://blogs.msdn.com/mstehle/archive/tags/TalkBack/default.aspx">TalkBack</category></item><item><title>Take Notice of Exchange Web Service Notifications</title><link>http://blogs.msdn.com/mstehle/archive/2008/07/24/take-notice-of-exchange-web-service-notifications.aspx</link><pubDate>Fri, 25 Jul 2008 00:11:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8770115</guid><dc:creator>mstehle</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/mstehle/comments/8770115.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mstehle/commentrss.aspx?PostID=8770115</wfw:commentRss><wfw:comment>http://blogs.msdn.com/mstehle/rsscomments.aspx?PostID=8770115</wfw:comment><description>&lt;p&gt;&lt;font face="Arial" size="2"&gt;The Exchange API-spotting blog, which is run by the &lt;a href="http://msdn.microsoft.com/en-us/exchange/default.aspx"&gt;Exchange MSDN content&lt;/a&gt; and Exchange API product&amp;#160; folks, as a new &lt;a href="http://blogs.msdn.com/exchangedev/archive/2008/07/24/transitioning-to-exchange-web-services-notifications.aspx"&gt;post&lt;/a&gt; about the transition from store event sinks to Exchange Web Service &lt;a href="http://msdn.microsoft.com/en-us/library/aa579128(EXCHG.80).aspx"&gt;notifications&lt;/a&gt;.&amp;#160; The aim is to provide some more detail about &lt;a href="http://msdn.microsoft.com/en-us/library/aa579128(EXCHG.80).aspx"&gt;notifications&lt;/a&gt; and try to directly answer some questions that have been posed by developers about how &lt;a href="http://msdn.microsoft.com/en-us/library/aa579128(EXCHG.80).aspx"&gt;notifications&lt;/a&gt; can realistically replace store event sinks when they &lt;a href="http://blogs.msdn.com/exchangedev/archive/2008/05/22/exchange-developer-roadmap.aspx"&gt;go away&lt;/a&gt;.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;font face="Arial" size="2"&gt;...If you have feedback for the product team about the transition or any scenarios that you are concerned about, please comment on their blog post.&amp;#160; These posts are going up well before the next release of Exchange in order to keep you informed but also to hear what you have to say.&amp;#160; The nice thing about Exchange 2007 is that you have EWS notifications already available to test with so while your store sinks might work now, you should begin thinking about and testing the migration of your sink solution to one based on EWS notifications.&amp;#160; If you hit roadblocks now &lt;a href="http://blogs.msdn.com/tags/DevMsgTeam/default.aspx"&gt;my team&lt;/a&gt; can work with you on Exchange 2007 and get answers before the upcoming release where Exchange store sinks are not a fallback option...&lt;/font&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Arial" size="2"&gt;In fact, the Exchange MSDN content team has been very busy spreading the word about what the transition from the gang of de-emphasized APIs (CDO 1.21, CDOEX, WebDAV, etc.) to the new ones (EWS and Agents) will look like...&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Arial" size="2"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/cc535018(EXCHG.80).aspx"&gt;Migrating from Exchange 2007 Legacy APIs&lt;/a&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Arial" size="2"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/cc720858(EXCHG.80).aspx"&gt;Migrating to Exchange Web Services, Part 1: Messaging&lt;/a&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Arial" size="2"&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=CDE26EA9-5647-448F-A5E6-AE094A882EE5&amp;amp;displaylang=en"&gt;Exchange 2007 Legacy API Property Mapping&lt;/a&gt;&lt;/font&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8770115" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mstehle/archive/tags/Exchange+General/default.aspx">Exchange General</category><category domain="http://blogs.msdn.com/mstehle/archive/tags/Exchange+Eventing/default.aspx">Exchange Eventing</category><category domain="http://blogs.msdn.com/mstehle/archive/tags/Exchange+Web+Services/default.aspx">Exchange Web Services</category><category domain="http://blogs.msdn.com/mstehle/archive/tags/DevMsgTeam/default.aspx">DevMsgTeam</category></item><item><title>Disclaimer: This post is about Disclaimers...</title><link>http://blogs.msdn.com/mstehle/archive/2008/07/23/disclaimer-this-post-is-about-disclaimers.aspx</link><pubDate>Wed, 23 Jul 2008 21:31:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8767500</guid><dc:creator>mstehle</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/mstehle/comments/8767500.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mstehle/commentrss.aspx?PostID=8767500</wfw:commentRss><wfw:comment>http://blogs.msdn.com/mstehle/rsscomments.aspx?PostID=8767500</wfw:comment><description>&lt;p&gt;&lt;font face="Arial" size="2"&gt;&lt;em&gt;I was reviewing a customer's case today and it reminded me of a topic I meant to blog about a while ago...&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Arial" size="2"&gt;Ever since Exchange 2000/2003 customers have tried to apply the &lt;a href="http://support.microsoft.com/kb/317680/"&gt;disclaimer SMTP sink sample&lt;/a&gt; to internal mail and found that the disclaimer text is not stamped on these messages.&amp;#160; Of course in Exchange 2000/2003 this &lt;a href="http://support.microsoft.com/?kbid=273233"&gt;won't work&lt;/a&gt;.&amp;#160; This is further described in the Exchange 2003 documentation on TechNet about &lt;a href="http://technet.microsoft.com/pt-br/library/bb124832(EXCHG.65).aspx"&gt;The Advanced Queuing Engine&lt;/a&gt;...&lt;/font&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font face="Arial" size="2"&gt;&lt;em&gt;&amp;quot;...the CDO interface does not support changing the content of store-submitted messages. This is a limitation that CDO_OnArrival event sinks share with all other event sinks. This limitation exists because Exchange converts a store-submitted message to a temporary SMTP version for the event sink to handle, and then discards the temporary version after the sink finishes processing...&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Arial" size="2"&gt;&lt;em&gt;...Because Exchange discards the temporary copy of a store-submitted message, you cannot use an event sink to add a disclaimer or other modifications to all outbound messages, unless you force all messages to be received through SMTP. To do this, you must install the event sink on a bridgehead server that is separate from the mailbox servers in your organization.&amp;quot;&lt;/em&gt;&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;font face="Arial" size="2"&gt;This is one of the better explanations about why disclaimers don't work for internal mail in Exchange 2000/2003 and provides more detail than the KB article.&amp;#160; &lt;/font&gt;&lt;font face="Arial" size="2"&gt;What you don't get from the KB article or the TechNet documentation is that in Exchange 2007 this all changes...&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Arial" size="2"&gt;The entire transport process is redone to the point that not only can internal messages have disclaimers added to them but there is no scripting or coding involved in doing so.&amp;#160; Exchange 2007 has built in &lt;a href="http://technet.microsoft.com/en-us/library/aa995961(EXCHG.80).aspx"&gt;transport rules&lt;/a&gt; that an administrator can turn on and configure as needed without writing code.&amp;#160; &lt;/font&gt;&lt;font face="Arial" size="2"&gt;The impact on Exchange development here is that the Exchange 2000/2003 experience leads many of us to assume that tasks like adding disclaimers, prepending text to the subject lines,&amp;#160; adding headers, adding recipients, or redirecting messages requires code but in Exchange 2007 it &lt;a href="http://technet.microsoft.com/en-us/library/aa998315(EXCHG.80).aspx"&gt;does not&lt;/a&gt;.&amp;#160; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Arial" size="2"&gt;&lt;em&gt;...Of course not every solution fits within the fixed set of conditions and actions defined for these transport rules - in those cases a custom transport agent can be used to implement whatever business logic is needed.&amp;#160; However, it is important to remember this functionality exists in Exchange 2007 before setting out on developing a custom solution as to not reinvent the wheel....&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8767500" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mstehle/archive/tags/Exchange+General/default.aspx">Exchange General</category><category domain="http://blogs.msdn.com/mstehle/archive/tags/Exchange+Eventing/default.aspx">Exchange Eventing</category><category domain="http://blogs.msdn.com/mstehle/archive/tags/DevMsgTeam/default.aspx">DevMsgTeam</category></item><item><title>OUTBOX: Registering a VB Script Store Sink</title><link>http://blogs.msdn.com/mstehle/archive/2006/04/06/outbox-registering-a-vb-script-store-sink.aspx</link><pubDate>Fri, 07 Apr 2006 00:18:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:570297</guid><dc:creator>mstehle</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/mstehle/comments/570297.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mstehle/commentrss.aspx?PostID=570297</wfw:commentRss><wfw:comment>http://blogs.msdn.com/mstehle/rsscomments.aspx?PostID=570297</wfw:comment><description>&lt;P&gt;&lt;EM&gt;&lt;FONT face=Arial size=2&gt;The following is an exerpt from an email describing the steps to setup a VBS event sink on Exchange...&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;DIV dir=ltr align=left&gt;&lt;FONT face=Arial size=2&gt;Before registering the event sink you need to install and configure a COM+ component which will execute the VB Script.&amp;nbsp; This COM+ ships with Exchange and is used to execute any VB Script event sinks on the server&lt;SPAN class=031061121-06042006&gt;.&amp;nbsp; You will need to download the Exchange Server SDK to get regevent.vbs and eshmts.vbs which are discussed below.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV dir=ltr align=left&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=031061121-06042006&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV dir=ltr align=left&gt;&lt;FONT size=+0&gt;&lt;FONT face=Arial&gt;&lt;FONT size=2&gt;&lt;SPAN class=031061121-06042006&gt;Y&lt;/SPAN&gt;ou only need to do the following steps one time on the server&lt;SPAN class=031061121-06042006&gt;...&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV dir=ltr align=left&gt;&lt;FONT face=Arial size=2&gt;1. Register the Script Host Component...&lt;BR&gt;&lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/_exch2k_the_script_host_sink.asp"&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/_exch2k_the_script_host_sink.asp&lt;/A&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV dir=ltr align=left&gt;&lt;FONT face=Arial size=2&gt;2. When you setup the Script Host in COM+ you will specify a domain account and password for the COM+ component to run as.&amp;nbsp; This account will need permissions to the mailboxes or folders that the sink will be registered to as well as local permissions to write to the log file.&amp;nbsp; You can give permissions to individual user accounts through Active Directory Users and Computers (ADUC).&amp;nbsp; In Exchange System Manager (ESM) you can give permissions organizational levels to provide broader access.&amp;nbsp; Also this scripts sends out email, for this script to be able to send mail as another account you need to grant that permission on the account in ADUC.&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV dir=ltr align=left&gt;&lt;FONT face=Arial size=2&gt;3. Setup the Script Host in COM+...&lt;BR&gt;&lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/_exch2k_the_eshmts_script.asp"&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/_exch2k_the_eshmts_script.asp&lt;/A&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV dir=ltr align=left&gt;&lt;FONT face=Arial size=2&gt;After setting up the Script Host, you will then register the script on each folder or mailbox that you want it to run.&amp;nbsp; I usually create a batch file to add and remove a script while testing.&amp;nbsp; You need to run your batch file as a user with write permissions to the mailbox or folder you are registering the script on.&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size=+0&gt;&lt;FONT face=Arial&gt;&lt;FONT size=2&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size=+0&gt;&lt;FONT face=Arial&gt;&lt;FONT size=2&gt;Here is the command I used in my batch file...&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;DIV&gt;&lt;FONT size=+0&gt;&lt;EM&gt;&lt;FONT face=Arial&gt;&lt;FONT size=2&gt;cscript "C:\Program Files\Exchange SDK\SDK\Support\OLEDB\Scripts\RegEvent.vbs" Add OnSave ExOleDB.ScriptEventSink.1 "&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;file://./backofficestorage/mstehle03.extest.microsoft.com/mbx/mrmet/inbox/scriptevent&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;" -file "C:\files\code\EventSinks\ScriptSinks\OnSave.vbs"&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;
&lt;DIV dir=ltr&gt;&lt;SPAN class=031061121-06042006&gt;&lt;FONT face=Arial size=2&gt;This will create a registration item&amp;nbsp;at the given file path.&amp;nbsp; Notice that my script is creating a registration item called "scriptevent" in mrmet's Inbox.&amp;nbsp; You will need to change the VBS file path and mailbox URL according to your environment.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV dir=ltr&gt;&lt;SPAN class=031061121-06042006&gt;&lt;FONT face=Arial size=2&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV dir=ltr&gt;&lt;SPAN class=031061121-06042006&gt;&lt;EM&gt;&lt;FONT face=Arial size=2&gt;...After following these steps there is no requirement for getting the VBS file on the file system as it is stored in the registration item itself.&amp;nbsp; If you do a GET on the registration item you will see your VBS code...&lt;/FONT&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV dir=ltr&gt;&lt;SPAN class=031061121-06042006&gt;&lt;EM&gt;&lt;FONT face=Arial size=2&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV dir=ltr&gt;&lt;SPAN class=031061121-06042006&gt;&lt;EM&gt;&lt;FONT face=Arial size=2&gt;...Another note&amp;nbsp;Exchange Explorer can setup these registrations through a wizard but for VBS sinks it doesn't add the script to the registration item, rather it creates a seperate IPM.Document that is the script file.&amp;nbsp; This is annoying because it isn't hidden and will appear in the folder when viewed in Outlook or OWA.&amp;nbsp; Obviously deleting this file will break the sink...&lt;/FONT&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=570297" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mstehle/archive/tags/OUTBOX/default.aspx">OUTBOX</category><category domain="http://blogs.msdn.com/mstehle/archive/tags/Exchange+Eventing/default.aspx">Exchange Eventing</category><category domain="http://blogs.msdn.com/mstehle/archive/tags/DevMsgTeam/default.aspx">DevMsgTeam</category></item><item><title>OUTBOX: Introduction to Exchange Store Event Sinks Part 2</title><link>http://blogs.msdn.com/mstehle/archive/2006/01/19/outbox-introduction-to-exchange-store-event-sinks-part-2.aspx</link><pubDate>Fri, 20 Jan 2006 00:52:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:514881</guid><dc:creator>mstehle</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/mstehle/comments/514881.aspx</comments><wfw:commentRss>http://blogs.msdn.com/mstehle/commentrss.aspx?PostID=514881</wfw:commentRss><wfw:comment>http://blogs.msdn.com/mstehle/rsscomments.aspx?PostID=514881</wfw:comment><description>&lt;FONT face=Arial size=2&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;Coming from Exchange 5.5 Event Service Scripts to Exchange Store Event Sinks involves more than just understanding the new events available and the registration process.&amp;nbsp; Exchange 5.5 event scripts are written in VBScript with CDO 1.21 as the API to interact with Exchange data.&amp;nbsp; Store Event Sinks can be written in VBScript, VB6, managed (.NET) code, and C++ they use ExOLEDB with ADO and CDOEX to interact with Exchange data.&amp;nbsp; This is greatly improves scalability and performance but requires a bit of retooling for the developer to be comfortable in their new surrounds.&amp;nbsp; The following information discusses what you need to know about the web store how to interact with data using CDOEX and ExOLEDB.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;&lt;STRONG&gt;Exchange Store&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;One important distinction to make between Exchange 5.5 and Exchange 200x is the storage architecture.&amp;nbsp; This is an important consideration when looking at the new API's available in Exchange 2000 and 2003 because many of the new API's relate to what is called Web Store or stream database that is added to the Exchange storage system.&amp;nbsp; Exchange store event sinks, WebDAV, CDOEX, and ExOLEDB with ADO&amp;nbsp;all work against the web store primarily&amp;nbsp;as opposed to&amp;nbsp;CDO 1.21 and MAPI which work against the ESE database (which was part of Exchange 5.5 as well and is commonly referred to as the MAPI database).&amp;nbsp; We will talk about ExOLEDB and CDOEX mainly because that is what you will use in an Exchange Store Event Sink.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN class=123062415-19012006&gt;&lt;FONT face=Arial size=2&gt;Exchange Storage Architecture&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN class=123062415-19012006&gt;&lt;FONT face=Arial size=2&gt;&lt;A href="http://www.microsoft.com/technet/prodtechnol/exchange/guides/E2k3TechRef/e82e8de0-803a-4c2b-b012-f73d6a677901.mspx" mce_href="http://www.microsoft.com/technet/prodtechnol/exchange/guides/E2k3TechRef/e82e8de0-803a-4c2b-b012-f73d6a677901.mspx"&gt;http://www.microsoft.com/technet/prodtechnol/exchange/guides/E2k3TechRef/e82e8de0-803a-4c2b-b012-f73d6a677901.mspx&lt;/A&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN class=123062415-19012006&gt;&lt;FONT face=Arial size=2&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN class=123062415-19012006&gt;&lt;SPAN class=123062415-19012006&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;MSDN Exchange Store Reference&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;&lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/wss_references_wss.asp" mce_href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/wss_references_wss.asp"&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/wss_references_wss.asp&lt;/A&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;&lt;STRONG&gt;CDOEX, ADO, Properties, and Exchange SQL&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;The web store uses native intermittent content such as MIME which allows access through ExOLEDB with ADO&amp;nbsp;and WebDAV and the use of SQL-like queries to find information.&amp;nbsp; This is quite helpful and a little more intuitive for the database programmer.&amp;nbsp; Each item (folders and messages) in the store can be created, modified, and searched like a row in a database were item properties are columns.&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;Folders can be used like tables and rows, for example to query the subfolders of a given root folder you would select the URL from all items in the root folder where the item "isFolder" column is "true"...&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;DIV&gt;&lt;SPAN class=123062415-19012006&gt;&lt;FONT face=Arial size=2&gt;&lt;EM&gt;Select "DAV:href" from scope('shallow traversal of &amp;lt;ROOT FOLDER URL&amp;gt;) Where "DAV:isfolder" = True&lt;/EM&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;
&lt;DIV dir=ltr&gt;&lt;SPAN class=123062415-19012006&gt;&lt;EM&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN class=123062415-19012006&gt;The following link provides a description of the SQL predicates supported against the web store.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV dir=ltr&gt;&lt;SPAN class=123062415-19012006&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV dir=ltr&gt;&lt;SPAN class=123062415-19012006&gt;Exchange Store SQL&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV dir=ltr&gt;&lt;SPAN class=123062415-19012006&gt;&lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/_exch2k_sql_web_storage_system_sql.asp" mce_href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/_exch2k_sql_web_storage_system_sql.asp"&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/_exch2k_sql_web_storage_system_sql.asp&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV dir=ltr&gt;&lt;SPAN class=123062415-19012006&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/SPAN&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;Add just like in a database when you write a query like the one of above you need to know two key pieces of data specific to your store, the table name and the available columns.&amp;nbsp; The table name is pretty easy to identify as it is the folder you what to query from.&amp;nbsp; The column names differ for each item type with some overlap.&amp;nbsp; For example appointment items and contact items have most of the same properties of a basic message but they also have their own unique properties that relate to their functions.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;The following link provides a listing of properties available on different items organized by namespace.&amp;nbsp; You will use the full namespace and property name when pulling fields from the Fields collection of a CDOEX object or querying in WebDAV or ADO.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;Properties by Namespace 
&lt;DIV&gt;&lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/wss_references_nsproperties.asp" mce_href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/wss_references_nsproperties.asp"&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/wss_references_nsproperties.asp&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;The interesting thing about this paradigm is that it is often quite easy for a database developer to walk in and start using ExOLEDB with ADO&amp;nbsp;and WebDAV to execute these kind of queries against Exchange.&amp;nbsp; However, a developer coming from MAPI or CDO 1.21 is usually left looking for the objFolder.Folders collection.&amp;nbsp; ExOLEDB with ADO&amp;nbsp;and WebDAV provide a way to retrieve raw information from the server, they are not an object model.&amp;nbsp; CDOEX provides some interfaces and CoClasses to provide a bit of an object model for interacting with the web store.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;&lt;/DIV&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;MSDN Reference for CDOEX CoClasses, Interfaces, etc.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;&lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/_esdk_reference_cdoex.asp" mce_href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/_esdk_reference_cdoex.asp"&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/_esdk_reference_cdoex.asp&lt;/A&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;In event sink development you will typically stay within the interfaces of the CDOEX object you open with the URL passed into the event interface.&amp;nbsp; Especially when working with meetings and contacts note that CDOEX provides a supported way for working with these item types.&amp;nbsp; ExOLEDB with ADO and much of WebDAV offers you raw access to the items in the web store, complex item types like appointments and contacts require CDOEX or special WebDAV commands to ensure that all the appropriate properties are being set to ensure that end user clients display and use the information appropriately.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;It is important to understand the limitations of each API and where you should use which.&amp;nbsp; CDOEX and ExOLEDB with ADO should only be used on an Exchange server, specifically they can only be used the Exchange server which hosts the mailboxes or public folders you want to access.&amp;nbsp; WebDAV should be used to remotely access Exchange mailboxes and folders that may not reside on the server it is running on, it can also be executed on a non-Exchange server.&amp;nbsp; All of these technologies are supported with managed (.NET) code, CDO 1.21 and MAPI are NOT supported with managed code.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;813349&amp;nbsp;Support policy for Microsoft Exchange APIs with the .NET Framework applications&lt;BR&gt;&lt;A href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;813349" mce_href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;813349"&gt;http://support.microsoft.com/default.aspx?scid=kb;EN-US;813349&lt;/A&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;&lt;STRONG&gt;Examples&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;Exchange Tasks&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;&lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/_e2k3_tasks.asp" mce_href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/_e2k3_tasks.asp"&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/_e2k3_tasks.asp&lt;/A&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;This is a great starting place when you are looking to see what you can do with Exchange API's.&amp;nbsp; There are all kinds of great code samples here to allow you to do all kinds of stuff against the store.&amp;nbsp; I have pulled a couple samples out that relate to some common tasks developers do inside event sinks.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;Adding an Appointment to the Calendar&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;&lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/_cdo_adding_an_appointment_directly_to_the_calendar.asp" mce_href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/_cdo_adding_an_appointment_directly_to_the_calendar.asp"&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/_cdo_adding_an_appointment_directly_to_the_calendar.asp&lt;/A&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;Responding to a Meeting Request&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;&lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/_cdo_responding_to_a_meeting_request.asp" mce_href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/_cdo_responding_to_a_meeting_request.asp"&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/_cdo_responding_to_a_meeting_request.asp&lt;/A&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;Listing Inbox Contents Using ADO&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN class=123062415-19012006&gt;&lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/_cdosys_listing_inbox_contents_using_ado.asp" mce_href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/_cdosys_listing_inbox_contents_using_ado.asp"&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/_cdosys_listing_inbox_contents_using_ado.asp&lt;/A&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;/FONT&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=514881" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/mstehle/archive/tags/OUTBOX/default.aspx">OUTBOX</category><category domain="http://blogs.msdn.com/mstehle/archive/tags/Exchange+Eventing/default.aspx">Exchange Eventing</category><category domain="http://blogs.msdn.com/mstehle/archive/tags/CDOEX/default.aspx">CDOEX</category><category domain="http://blogs.msdn.com/mstehle/archive/tags/DevMsgTeam/default.aspx">DevMsgTeam</category></item></channel></rss>