<?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>Ryan's Look at Outlook Programmability : Object Model</title><link>http://blogs.msdn.com/rgregg/archive/tags/Object+Model/default.aspx</link><description>Tags: Object Model</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Additional Shutdown Changes for Outlook 2010 Beta</title><link>http://blogs.msdn.com/rgregg/archive/2009/10/02/additional-shutdown-changes-for-outlook-2010-beta.aspx</link><pubDate>Sat, 03 Oct 2009 00:46:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9902592</guid><dc:creator>rgregg</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/rgregg/comments/9902592.aspx</comments><wfw:commentRss>http://blogs.msdn.com/rgregg/commentrss.aspx?PostID=9902592</wfw:commentRss><wfw:comment>http://blogs.msdn.com/rgregg/rsscomments.aspx?PostID=9902592</wfw:comment><description>&lt;P&gt;As part of Outlook 2010 and Outlook 2007 SP2, the Outlook team has taken a new and harder stance on performance. We strived to make these versions of Outlook the fastest, most performant versions released. To accomplish this, we’ve been making some significant changes to the way Outlook works across the board and in shutdown specifically. Over the course of the last year, we’ve focused on ensuring Outlook shuts down properly when the user closes the application.&lt;/P&gt;
&lt;H4&gt;Background&lt;/H4&gt;
&lt;P&gt;Outlook often has issues shutting down on command. Even when it did shutdown, it often took much longer than expected. Our goal for this release is to ensure Outlook &lt;B&gt;always&lt;/B&gt; shuts down and put this issue to rest. With this release we want to put this issue to rest. To facilitate that, we started making a series of changes that ensure Outlook shuts down quickly and consistently. &lt;/P&gt;
&lt;P&gt;In Outlook 2007 SP2, we &lt;A href="http://blogs.msdn.com/rgregg/archive/2008/10/27/application-shutdown-changes-in-outlook-2007-service-pack-2-beta.aspx" mce_href="http://blogs.msdn.com/rgregg/archive/2008/10/27/application-shutdown-changes-in-outlook-2007-service-pack-2-beta.aspx"&gt;added a new design to MAPI providers&lt;/A&gt; where we only do the minimal work necessary to prevent data loss before Outlook exits and will sidestep some of the normal shutdown logic. Outlook SP2 also prevents external COM add-ins from keeping Outlook running after the user closed Outlook. The big pain point was that all MAPI Providers had to opt-in to the design and support the new behavior because of compatibility concerns of this change in a service pack.&lt;/P&gt;
&lt;P&gt;In Outlook 2010 Technical Preview, the design was modified so that a MAPI provider needed to opt-out of the new shutdown method. If a MAPI provider does not implement the fast shutdown API, Outlook 2010 will still shut down using the fast method. &lt;/P&gt;
&lt;P&gt;These changes have done a lot to ensure that Outlook always shuts down and is able to shut down quickly, as the user intended. Since the technical preview release, we continued to monitor the feedback from beta testers and users to determine how effective these changes have been. Looking through the data we’ve collected, it’s become clear that there is another significant source of shutdown pain: Outlook add-ins. We found that add-ins would perform expensive operations and network I/O during shut down events. Because of that impact, we expanded our investment in improving Outlook’s shutdown behavior by creating a fast shutdown model for add-ins as well.&lt;/P&gt;
&lt;H4&gt;Add-in Shutdown Changes in Outlook 2010 Beta&lt;/H4&gt;
&lt;P&gt;Starting with the Outlook 2010 Beta, Outlook, by default, will not signal add-ins that it is shutting down. Specifically, the beta version will no longer call &lt;B&gt;OnBeginShutdown&lt;/B&gt; and &lt;B&gt;OnDisconnection&lt;/B&gt; methods of the IDTExtensibility2 interface when Outlook is shutting down with fast shutdown. If you have a Visual Studio Tools for Office (VSTO) add-in, you will not see the &lt;B&gt;ThisAddin_Shutdown&lt;/B&gt; method called.&lt;/P&gt;
&lt;P&gt;The impact to an add-in from this change depends on what the add-in was doing during these events. In most add-ins, these events are used to release references to Outlook COM objects and clean memory that was allocated during the session. In these cases, the impact to the add-in will be minimal. Outlook will release the remaining COM object references and shutdown, and Windows will reclaim the allocated memory when the process exits.&lt;/P&gt;
&lt;P&gt;For some add-ins, the change is more impactful. If an add-in uses these events to commit data (for example, storing user settings or reporting usage to a web server) this will no longer occur. Depending on the scenario, this may or may not have a user visible impact. Add-ins will either need to be modified to be compatible with this new behavior, or an IT administrator will need to use group policy to restore the original behavior for the specific add-in. &lt;/P&gt;
&lt;P&gt;These methods can and will be called in other scenarios, such as if the add-in is manually disconnected or if slow shutdown is enabled through group policy, so it is important that developers continue to code as though these methods would be called. More information about best practices is listed below.&lt;/P&gt;
&lt;H4&gt;Reasons for this Change&lt;/H4&gt;
&lt;P&gt;This change has a pretty significant impact and is not a change we made lightly. Looking over the data we’ve collected in the last year, it became clear we needed to do more to help shutdown faster. The data from Outlook 2007 SP2 indicated that if the user had “misbehaving” add-ins installed, the average delay to shutdown was 13 seconds. For Outlook 2010 technical preview, the data shows an average delay of 15-20 seconds.&lt;/P&gt;
&lt;P&gt;As part of our add-in compatibility testing, we’ve examined what add-ins are doing in their shutdown/disconnect events. While a majority of add-ins are performing simple tasks like releasing references, several add-ins we’ve identified are making web service calls or other “long running” operations synchronously during these events. &lt;/P&gt;
&lt;P&gt;The benefit of making this change is that for the majority of add-ins and customers, Outlook will work significantly better than it has in the past when shutting down. This change improves our ability to respond to the user’s intent and exit quickly, letting the user move on to the next task or shutdown their computer. &lt;/P&gt;
&lt;H4&gt;For Developers: Best Practices for Add-in Shutdown&lt;/H4&gt;
&lt;P&gt;For add-in developers, the new world of Outlook shutdown can seem a little tricky to operate in. It is important that developers follow the best practices for add-in shutdown to ensure that our shared users continue to benefit from a fast and responsible Outlook shutdown experience.&lt;/P&gt;
&lt;H5&gt;Practice #1: Continue to Release References in OnDisconnection&lt;/H5&gt;
&lt;P&gt;It is important that you continue to write code in &lt;B&gt;OnDisconnection&lt;/B&gt; or &lt;B&gt;ThisAddin_Shutdown&lt;/B&gt; to release any remaining COM references to Outlook objects. In Outlook 2003 and Outlook 2007 pre-SP2, these references can prevent Outlook from shutting down. Even in Outlook 2010 you should continue to release references and allocated memory in these events because there are scenarios where slow shutdown will be used or the user could manually disconnect your add-in through the COM Add-ins dialog.&lt;/P&gt;
&lt;H5&gt;Practice #2: Detecting when Outlook is shutting down&lt;/H5&gt;
&lt;P&gt;If you need to detect that Outlook is shutting down, you can use the &lt;B&gt;Application.Quit&lt;/B&gt; event in the Outlook object model to receive a notification that the process is shutting down. You should respond quickly to this event and return control back to Outlook as quickly as possible. Add-ins should focus on not having a perceivable impact on Outlook shutdown when compared with shutdown when the add-in is not running.&lt;/P&gt;
&lt;P&gt;If you have long running or indeterminate length running operations to perform at shutdown, consider the following questions:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Does this need to happen when Outlook shuts down? What happens if Outlook crashes and this code doesn’t run?&lt;/LI&gt;
&lt;LI&gt;Can the operation be made to be “pay for play” where changes are committed when the user makes the change instead of being saved for later?&lt;/LI&gt;
&lt;LI&gt;Can the work be done on a background thread instead of synchronously during a quit event? (Note: you cannot make OM calls from a background thread, but can use MAPI directly if properly initialized)&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Explicitly, you should not do network I/O during any quit event. This includes saving data to a network share, writing data to an Outlook online-mode store, or calling web services during Application.Quit, OnBeginShutdown or OnDisconnection.&lt;/P&gt;
&lt;P&gt;In using the Application.Quit event, you should not perform any release of Outlook COM objects or allocated memory in the Outlook process space. This will be done for you by Outlook and Windows when the process exits.&lt;/P&gt;
&lt;P&gt;One case we’ve seen internally as we started looking at what add-ins were doing during shutdown was where an add-in was reporting usage information back to a web service in the shutdown events. Instead of recording this data directly to the web service during shutdown, we altered the code to instead report the previous session usage information on a background thread sometime during the next Outlook boot. This way the data can still be uploaded, but Outlook is never blocked by the work.&lt;/P&gt;
&lt;P&gt;Another alternative, if you have another executable that is already part of your solution, is to move work out of the add-in and into your executable. This way the work can be done regardless of if Outlook is running, and without blocking Outlook’s ability to start up or shut down quickly.&lt;/P&gt;
&lt;H5&gt;Practice #3: Test shutdown using both the fast and old methods&lt;/H5&gt;
&lt;P&gt;As a developer, you should ensure that your add-in has a negligible impact on Outlook’s user experience. This includes testing the impact your add-in makes to Outlook’s boot time, the general user experience while using Outlook, common scenarios (like composing a new message, replying to a message, folder switch, sending mail, etc) and shut down. Specifically, developers should test the difference between the shutdown times of outlook when changing the registry settings for the add-in that control how Outlook shuts down.&lt;/P&gt;
&lt;H4&gt;For IT Administrators&lt;/H4&gt;
&lt;P&gt;If you have internal add-ins or solutions that cannot be updated to support the new design, you can deploy group policy to your users to revert the behavior. There are two methods for enabling shutdown notifications to Outlook add-ins in Outlook 2010 Beta:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;B&gt;Selectively for individual add-ins (the preferred approach):&lt;/B&gt; While this cannot be deployed through group policy, it can be enabled as part of add-in deployments and is useful if backwards compatibility is required for specific add-ins.&lt;/LI&gt;
&lt;LI&gt;&lt;B&gt;Globally for all add-ins&lt;/B&gt;: this is recommended for organizations with a large number of internal solutions or desktops that need to deploy this setting to ensure compatibility during a rollout of Outlook 2010.&lt;/LI&gt;&lt;/UL&gt;
&lt;H5&gt;Individual Add-in Setting&lt;/H5&gt;
&lt;P&gt;By using this setting Outlook will selectively provide shutdown notifications to the specified add-in without notifying all add-ins. This setting is configured per add-in through the add-in registration in either HKCU or HKLM registry hives, by adding an additional value to the add-in registration:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;HKCU\Software\Microsoft\Office\Outlook\Add-ins\&amp;lt;ProgID&amp;gt; &lt;BR&gt;[RequireShutdownNotification]=dword:0x1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Setting this value to 0x1 will enable the add-in to receive the blocked callbacks during Outlook shutdown. This will have an impact to the performance of Outlook shutdown that should be evaluated as part of a deployment. This setting should only be used if an add-in has significant compatibility issues with Outlook 2010’s new shutdown design.&lt;/P&gt;
&lt;H5&gt;Global Setting&lt;/H5&gt;
&lt;P&gt;This setting can be used to change the new shutdown design to match the design used by Outlook 2007. This setting can be deployed through group policy either per user or per machine.&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;HKCU\Policies\Microsoft\Office\Outlook\14.0\Options\Shutdown &lt;BR&gt;[AddinFastShutdownBehavior]=dword:0x1&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Setting AddinFastShutdownBehavior to 1 will enable shutdown notifications for all add-ins. Setting the value to 0 will use the default behavior.&lt;/P&gt;
&lt;P&gt;These two settings provide administrators complete control over the effect this new behavior has on custom solutions and add-ins used in the enterprise. During evaluation of Outlook 2010 beta, it is important that organizations test any custom solutions using Outlook add-ins to ensure compatibility with this change.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9902592" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/rgregg/archive/tags/Object+Model/default.aspx">Object Model</category><category domain="http://blogs.msdn.com/rgregg/archive/tags/Outlook/default.aspx">Outlook</category><category domain="http://blogs.msdn.com/rgregg/archive/tags/Common+Problems/default.aspx">Common Problems</category><category domain="http://blogs.msdn.com/rgregg/archive/tags/performance/default.aspx">performance</category><category domain="http://blogs.msdn.com/rgregg/archive/tags/shutdown/default.aspx">shutdown</category><category domain="http://blogs.msdn.com/rgregg/archive/tags/IT/default.aspx">IT</category><category domain="http://blogs.msdn.com/rgregg/archive/tags/developer/default.aspx">developer</category><category domain="http://blogs.msdn.com/rgregg/archive/tags/administrator/default.aspx">administrator</category></item><item><title>Application Shutdown Changes in Outlook 2007 Service Pack 2 Beta</title><link>http://blogs.msdn.com/rgregg/archive/2008/10/27/application-shutdown-changes-in-outlook-2007-service-pack-2-beta.aspx</link><pubDate>Mon, 27 Oct 2008 22:17:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9018839</guid><dc:creator>rgregg</dc:creator><slash:comments>21</slash:comments><comments>http://blogs.msdn.com/rgregg/comments/9018839.aspx</comments><wfw:commentRss>http://blogs.msdn.com/rgregg/commentrss.aspx?PostID=9018839</wfw:commentRss><wfw:comment>http://blogs.msdn.com/rgregg/rsscomments.aspx?PostID=9018839</wfw:comment><description>&lt;p&gt;As part of the performance improvements we’ve made for Outlook 2007 SP2 beta, we’ve changed the way Outlook manages the lifecycle of the application. In the past, Outlook followed the best practices for Component Object Model (COM) servers and allowed clients of the Outlook server to control the lifecycle of Outlook. This caused a significant end-user side effect: often the user could not close Outlook because of lingering external references. This is confusing and frustrating for our users, and many users would often use Task Manager to terminate the Outlook process.&lt;/p&gt;  &lt;p&gt;As a result of strong and long-standing customer feedback about the need to close Outlook and have Outlook stop running, Service Pack 2 changes the way Outlook closes, ensuring that the user’s intent to close Outlook is respected. These changes mean the way the Outlook COM server shuts down has changed significantly, which may impact solutions using the Outlook object model outside of the Outlook process.&lt;/p&gt;  &lt;h4&gt;Impact for Add-ins: None&lt;/h4&gt;  &lt;p&gt;&lt;b&gt;If you’ve written an in-process add-in for Outlook this change does not affect you.&lt;/b&gt; The lifecycle of in-process add-ins and in-process COM references in Outlook 2007 has always been the same as the lifecycle of the application. When the user closes the last Outlook window and Outlook starts to shut down, add-ins are disconnected and references are released.&lt;/p&gt;  &lt;p&gt;Add-ins can use the Quit event on the Application object to determine when Outlook will be closing down. After the Quit event is raised, add-ins will have their OnDisconnection method called, and then the add-in and Outlook will close.&lt;/p&gt;  &lt;h4&gt;Impact for Cross Process Solutions&lt;/h4&gt;  &lt;p&gt;Before Outlook 2007 SP2, Outlook would check for external (out of process) references on the COM Server objects and wait for those references to be released before Outlook would close. This would enable solutions that were depending on Outlook data to keep Outlook running until the references were released. This is common behavior for COM servers, but is unexpected behavior for end users, who expect that an application will close when they close the last window of the application (or at least reasonably soon after they close the last window).&lt;/p&gt;  &lt;p&gt;Starting with Outlook 2007 Service Pack 2, Outlook will ignore external COM references when determining if Outlook should exit. When a user closes the last Outlook window, Outlook will start exiting the process: this involves raising the Quit event on the Application object, disconnect all add-ins, disconnecting external references, persisting in-memory changes to the disk, and then exiting. All external COM references will be disconnected immediately after the Quit event is raised on the Application object.&lt;/p&gt;  &lt;p&gt;Because of the way COM works, when Outlook releases the external references, those objects become disconnected objects in cross process solutions. When a solution attempts to use the disconnected reference, an error will result from any call to the object (RPC_E_DISCONNECTED). Solutions that are not designed to handle this error may crash or otherwise misbehave. This will occur any time a solution attempts to use an object reference after Outlook has closed.&lt;/p&gt;  &lt;p&gt;To work correctly with the new behavior in Outlook, your solution should listen for the Quit event on the Application object. When that event is raised, stop any work in progress using Outlook data, and release all Outlook references. Any remaining references after the solution returns from the Quit event will be disconnected. &lt;/p&gt;  &lt;p&gt;While handling the Quit event, a solution should return from the event as quickly as possible. While a solution is working in the Quit event, Outlook may appear hung to the user and the operating system and the user may forcibly terminate Outlook instead of waiting for it to finish closing. &lt;/p&gt;  &lt;p&gt;If your solution needs to access data from Outlook after the process has shutdown, it can do so by starting the process up again in UI-less mode by calling CoCreateInstance(). However, you should attempt to design your solution such that data from Outlook is only collected while Outlook is running. I’ll be blogging about an example of how to design a solution that works this way in an upcoming blog post.&lt;/p&gt;  &lt;h4&gt;Special Cases&lt;/h4&gt;  &lt;p&gt;While the text above describes the default, we realize that there are customers and solutions which will be negatively impacted by this change until the solution can be updated. To restore the old behavior, administrators can set a registry key to force Outlook to wait for all external references to be released before closing.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;i&gt;This registry key applies to Outlook 2007 SP2 beta, the registry key may change for the final release of SP2.&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;[HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Outlook\Options\Shutdown]    &lt;br /&gt;“AllowShutdownWithExternalReferences”=dword:00000000&lt;/p&gt;  &lt;p&gt;We’ve also done work to ensure that when a solution uses CoCreateInstance and Outlook isn’t running, the right things happen. In those cases, Outlook will remain running in “headless mode” without any visible user interface. If the user launches Outlook, a new Outlook window will appear in the same session Outlook was already using. If the user closes that window, even though the process was started by a solution, Outlook will exit in the same manner as it would if the application was started by the user.&lt;/p&gt;  &lt;h4&gt;Summary&lt;/h4&gt;  &lt;p&gt;As part of a larger overall performance improvement effort in Outlook 2007 Service Pack 2, the team has invested a significant amount of time to improve the experience around closing Outlook. We’ve also made changes to ensure that Outlook boots faster and is more responsive all around. &lt;/p&gt;  &lt;p&gt;I’m interested in your feedback on this new shutdown logic, and any thoughts or questions about how we can continue to improve this experience in the next Outlook release. Please leave a comment on this post and let me know what you have to say.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9018839" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/rgregg/archive/tags/Object+Model/default.aspx">Object Model</category><category domain="http://blogs.msdn.com/rgregg/archive/tags/Information/default.aspx">Information</category><category domain="http://blogs.msdn.com/rgregg/archive/tags/.NET/default.aspx">.NET</category><category domain="http://blogs.msdn.com/rgregg/archive/tags/Common+Problems/default.aspx">Common Problems</category><category domain="http://blogs.msdn.com/rgregg/archive/tags/events/default.aspx">events</category><category domain="http://blogs.msdn.com/rgregg/archive/tags/troubleshooting/default.aspx">troubleshooting</category><category domain="http://blogs.msdn.com/rgregg/archive/tags/performance/default.aspx">performance</category><category domain="http://blogs.msdn.com/rgregg/archive/tags/shutdown/default.aspx">shutdown</category></item><item><title>Use the Right Events for the Right Cases</title><link>http://blogs.msdn.com/rgregg/archive/2008/08/27/use-the-right-events-for-the-right-cases.aspx</link><pubDate>Wed, 27 Aug 2008 21:25:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8901021</guid><dc:creator>rgregg</dc:creator><slash:comments>8</slash:comments><comments>http://blogs.msdn.com/rgregg/comments/8901021.aspx</comments><wfw:commentRss>http://blogs.msdn.com/rgregg/commentrss.aspx?PostID=8901021</wfw:commentRss><wfw:comment>http://blogs.msdn.com/rgregg/rsscomments.aspx?PostID=8901021</wfw:comment><description>&lt;P&gt;One of the problems I often hear about from Outlook developers is that the sequencing of a particular event isn’t ideal for what they are trying to do. While sometimes this can be a hole in the Outlook platform, more often than not it’s because the developer isn’t using the best event for the scenario they are trying to build. Outlook often has multiple events that fire related to particular actions in the UI, and choosing the right event is important to ensure data consistency.&lt;/P&gt;
&lt;P&gt;For example, recently I was helping a partner team who wanted to examine the contents of a meeting request when the user has actually sent the request. During this event, they would compare the state of the meeting in their system against the meeting that the user was sending, and fix up any inconsistencies in their database. The developer had found the &lt;I style="mso-bidi-font-style: normal"&gt;AppointmentItem_Send&lt;/I&gt; event in the object model, and naturally presumed that was the right event to use. However, they started to notice that inconsistencies were occurring between items in Outlook and their database. Multiple-client issues aside, the problem is because of the event they used.&lt;/P&gt;
&lt;P&gt;The Item_Send event fires when the user clicks the Send button on sendable items (Meeting requests, e-mail messages, etc). However, there are cases where the user can back out of sending the item after they click the send button. In this particular case, when a meeting is changed, the user is sometimes given a choice to send the updates to added/removed recipients, or to all recipients. If the user clicks cancel on this dialog, the send is canceled even though the Send event has fired.&lt;/P&gt;
&lt;P&gt;To work around this issue, I instructed the developer to listen for the &lt;I style="mso-bidi-font-style: normal"&gt;Application_ItemSend&lt;/I&gt; event instead. This event fires after the user has committed to sending the message and ensures that the recipients on the item reflect the state of the item after the inspector has been closed.&lt;/P&gt;
&lt;P&gt;Likewise, there is a Close event on each of the item classes, as well as a Close event on the Inspector object. To ensure that you inspect the contents of the item after all edits have occurred, catching the &lt;I style="mso-bidi-font-style: normal"&gt;Inspector_Close&lt;/I&gt; event will provide you with the best chance to see that information. After Item_Close has fired, there is still a chance the user will back out of the changes (for example, if they click No to save their changes).&lt;/P&gt;
&lt;P&gt;There are times where using the Item_Close and Item_Send events are very useful though. For example, if you want to be able to cancel the event and prevent the item from being closed or sent, these events have a Cancel parameter which can be set to True to prevent the action from occurring. The more deterministic events on the Inspector and Application object are not cancelable, because that would affect their determinism.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8901021" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/rgregg/archive/tags/Object+Model/default.aspx">Object Model</category><category domain="http://blogs.msdn.com/rgregg/archive/tags/Information/default.aspx">Information</category><category domain="http://blogs.msdn.com/rgregg/archive/tags/Common+Problems/default.aspx">Common Problems</category><category domain="http://blogs.msdn.com/rgregg/archive/tags/events/default.aspx">events</category><category domain="http://blogs.msdn.com/rgregg/archive/tags/troubleshooting/default.aspx">troubleshooting</category></item><item><title>Why are you still using ECEs?</title><link>http://blogs.msdn.com/rgregg/archive/2007/10/12/why-are-you-still-using-eces.aspx</link><pubDate>Sat, 13 Oct 2007 01:35:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5430472</guid><dc:creator>rgregg</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/rgregg/comments/5430472.aspx</comments><wfw:commentRss>http://blogs.msdn.com/rgregg/commentrss.aspx?PostID=5430472</wfw:commentRss><wfw:comment>http://blogs.msdn.com/rgregg/rsscomments.aspx?PostID=5430472</wfw:comment><description>&lt;p&gt;Stephen Griffin is asking this &lt;a href="http://blogs.msdn.com/stephen_griffin/archive/2007/10/12/whither-ece.aspx"&gt;question over on his blog&lt;/a&gt;. If you're using Exchange Client Extensions and haven't been able to port your solution over to an add-in (for a reason other than budget concerns or legacy support), now would be a good time to chime in and let him know why.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5430472" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/rgregg/archive/tags/Object+Model/default.aspx">Object Model</category><category domain="http://blogs.msdn.com/rgregg/archive/tags/General/default.aspx">General</category></item><item><title>Common Properties on Outlook Controls</title><link>http://blogs.msdn.com/rgregg/archive/2007/10/01/common-properties-on-outlook-controls.aspx</link><pubDate>Tue, 02 Oct 2007 03:12:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5231879</guid><dc:creator>rgregg</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/rgregg/comments/5231879.aspx</comments><wfw:commentRss>http://blogs.msdn.com/rgregg/commentrss.aspx?PostID=5231879</wfw:commentRss><wfw:comment>http://blogs.msdn.com/rgregg/rsscomments.aspx?PostID=5231879</wfw:comment><description>&lt;p&gt;If you’ve started to take advantage of the new Outlook controls on form regions in Outlook 2007, you may have noticed something strange. None of the controls have common properties you would expect all controls to have: Visible, Width, Height, Top, Left, etc. You might be thinking we missed some obvious test case here, but you’d be wrong.  &lt;p&gt;These properties do in fact exist on the controls. However, because of a complexity of COM and Office dependencies, the properties do not show up in the type library exposed by Outlook.  &lt;p&gt;Each of the Outlook controls (they all start with Olk in the type library) also implement the Control interface from fm20.dll. This interface includes all common properties, including Height, Width, Top, Left, Name, Parent, TabIndex, TabStop, Visible and more.  &lt;p&gt;If you are using a language that supports late binding for COM objects, you can just reference the property directly and everything will work as expected.  &lt;p&gt;If you’re writing managed code, or other code which requires explicit definitions of the properties, you will need to cast the control object to the Control interface from fm20.dll to read or write these properties. For example, if you’re writing in C#, you would need to do something like the following:  &lt;p&gt;&lt;font face="Conso" size="2"&gt;using Outlook = Microsoft.Office.Interop.Outlook;&lt;br&gt;&lt;/font&gt;&lt;font face="Conso" size="2"&gt;using MSForms = Microsoft.Vbe.Interop.Forms;&lt;/font&gt;  &lt;p&gt;&lt;font face="Conso" size="2"&gt;public void BeforeFormRegionShow(Outlook.FormRegion FormRegion)&lt;br&gt;&lt;/font&gt;&lt;font face="Conso" size="2"&gt;{&lt;br&gt;&lt;/font&gt;&lt;font face="Conso" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Find OlkButton1 and make it invisible&lt;br&gt;&lt;/font&gt;&lt;font face="Conso" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MSForms.UserForm canvas = FormRegion.Form as MSForms.UserForm;&lt;br&gt;&lt;/font&gt;&lt;font face="Conso" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Outlook.OlkCommandButton button1 = &lt;br&gt;&lt;/font&gt;&lt;font face="Conso" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; canvas.Controls.Item("OlkButton1") as Outlook.OlkCommandButton;&lt;br&gt;&lt;/font&gt;&lt;font face="Conso" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //button1.Visible = false; // can't do this, it doesn't compile&lt;br&gt;&lt;/font&gt;&lt;font face="Conso" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MSForms.Control ctrlButton1 = (MSForms.Control)button1;&lt;br&gt;&lt;/font&gt;&lt;font face="Conso" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ctrlButton1.Visible = false; // this works!&lt;br&gt;&lt;/font&gt;&lt;font face="Conso" size="2"&gt;}&lt;/font&gt;  &lt;p&gt;We tried to find a way to combine these two interfaces together, but because Outlook doesn’t have a dependency on the Microsoft Forms library, it wasn’t feasible to make it work right. There is at least a work-around for developers who need to access these properties.  &lt;p&gt;You can also access additional Outlook-specific properties on controls by casting the control to the OlkControl interface in Outlook. This interface provides you with the ability to control layout settings for how the control will behave on the form. These properties can be set either at runtime or design time, as long as you set them before the layout is calculated (which occurs just after BeforeFormRegionShow).&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5231879" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/rgregg/archive/tags/Object+Model/default.aspx">Object Model</category><category domain="http://blogs.msdn.com/rgregg/archive/tags/Forms/default.aspx">Forms</category><category domain="http://blogs.msdn.com/rgregg/archive/tags/.NET/default.aspx">.NET</category></item><item><title>Why does my Outlook event seem to stop working</title><link>http://blogs.msdn.com/rgregg/archive/2007/07/04/why-does-my-outlook-event-seem-to-stop-working.aspx</link><pubDate>Wed, 04 Jul 2007 18:39:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3691097</guid><dc:creator>rgregg</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/rgregg/comments/3691097.aspx</comments><wfw:commentRss>http://blogs.msdn.com/rgregg/commentrss.aspx?PostID=3691097</wfw:commentRss><wfw:comment>http://blogs.msdn.com/rgregg/rsscomments.aspx?PostID=3691097</wfw:comment><description>&lt;p&gt;&lt;a href="http://weblogs.asp.net/whaggard/"&gt;Wes&lt;/a&gt; has a &lt;a href="http://weblogs.asp.net/whaggard/archive/2007/07/04/why-does-my-outlook-event-seem-to-stop-working.aspx"&gt;good post&lt;/a&gt; over on his blog explaining another common problem that a lot of Outlook solution developers run into:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;em&gt;Imagine&amp;nbsp;we have some code in an Outlook addin that looks similar to code below. Does anyone see anything wrong with it? It simply places a button on the menu bar and shows a message box when the button is clicked. The code works for sometime but then all of a sudden the button mysteriously stops working. What gives?&amp;nbsp;&lt;/em&gt;&lt;/p&gt;&lt;pre&gt;using Office = Microsoft.Office.Core;
using Outlook = Microsoft.Office.Interop.Outlook;
...&lt;/pre&gt;&lt;pre&gt;void SetupCommandBar(Outlook.Application application)
{
    Office.CommandBar menu = &lt;br&gt;       application.ActiveExplorer().CommandBars.ActiveMenuBar;

    Office.CommandBarButton button = menu.Controls.Add(&lt;br&gt;        Office.MsoControlType.msoControlButton,
        Type.Missing, Type.Missing, Type.Missing, true) &lt;br&gt;        as Office.CommandBarButton;

    button.Caption = "Click Me!";
    button.Click += &lt;br&gt;      new Office._CommandBarButtonEvents_ClickEventHandler(button_Click);
}&lt;/pre&gt;&lt;pre&gt;void button_Click(Microsoft.Office.Core.CommandBarButton Ctrl,&lt;br&gt;ref bool CancelDefault)
{
    System.Windows.Forms.MessageBox.Show("Clicked Button!");
}&lt;/pre&gt;
&lt;p&gt;&lt;em&gt;The button stops working due to the mystical powers of the .Net garbage collector. If we look closely we notice that the button object is locally scoped in the SetupCommandBar function, thus once we execute that function the button object is free to be cleaned up. However, until the button object is actually destroyed by the garbage collector the button click event will fire and the button will work. Due to the&amp;nbsp;non-deterministic nature of the garbage collector we have no idea how long the button will work. In my simple testing it seemed to work for a little while but if you want to speed up the process add a call go GC.Collect in the button_Click callback. &lt;/em&gt;
&lt;p&gt;&lt;em&gt;The easiest fix for this problem is to change the scope of the button object to be a&amp;nbsp;member variable of enclosing class. By doing this we ensure that the button object stays alive and works until we are ready for it to stop working.&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3691097" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/rgregg/archive/tags/Object+Model/default.aspx">Object Model</category><category domain="http://blogs.msdn.com/rgregg/archive/tags/Outlook/default.aspx">Outlook</category><category domain="http://blogs.msdn.com/rgregg/archive/tags/.NET/default.aspx">.NET</category><category domain="http://blogs.msdn.com/rgregg/archive/tags/Common+Problems/default.aspx">Common Problems</category></item><item><title>Mysterious Errors When Using Form Regions from Managed Code Add-ins</title><link>http://blogs.msdn.com/rgregg/archive/2007/06/21/mysterious-errors-when-using-form-regions-from-managed-code-add-ins.aspx</link><pubDate>Fri, 22 Jun 2007 00:35:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3448498</guid><dc:creator>rgregg</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/rgregg/comments/3448498.aspx</comments><wfw:commentRss>http://blogs.msdn.com/rgregg/commentrss.aspx?PostID=3448498</wfw:commentRss><wfw:comment>http://blogs.msdn.com/rgregg/rsscomments.aspx?PostID=3448498</wfw:comment><description>&lt;P&gt;I've been noticing some feedback lately where a number of developers were having problems working with the controls on their form region.&amp;nbsp; Usually, these problems manifested as Outlook's object model&amp;nbsp;returning null values back when trying to access the Controls collection of the UserForm object in the Microsoft Forms 2.0 library (which was accessed from the FormRegion.Form property).&lt;/P&gt;
&lt;P&gt;This can be especially frustrating, because it looks like you've done everything right, and Outlook is just giving you back something that is totally wrong. Turns out, that isn't quite the case.&lt;/P&gt;
&lt;P&gt;If you've added a reference to the 'Microsoft Forms 2.0' type library, you might have added the wrong reference to your project.&amp;nbsp;On some computers, you'll find two different listings for the forms type library in the Add Reference dialog:&lt;/P&gt;
&lt;P align=center&gt;&lt;A href="http://blogs.msdn.com/blogfiles/rgregg/WindowsLiveWriter/MysteriousErrorsWhenUsingFormRegionsfrom_F2A2/AddReferenceDialog%5B7%5D.jpg" atomicselection="true" mce_href="http://blogs.msdn.com/blogfiles/rgregg/WindowsLiveWriter/MysteriousErrorsWhenUsingFormRegionsfrom_F2A2/AddReferenceDialog%5B7%5D.jpg"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=197 src="http://blogs.msdn.com/blogfiles/rgregg/WindowsLiveWriter/MysteriousErrorsWhenUsingFormRegionsfrom_F2A2/AddReferenceDialog_thumb%5B1%5D.jpg" width=240 border=0 mce_src="http://blogs.msdn.com/blogfiles/rgregg/WindowsLiveWriter/MysteriousErrorsWhenUsingFormRegionsfrom_F2A2/AddReferenceDialog_thumb%5B1%5D.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P align=left&gt;Depending on which reference you select, you'll either get a reference properly associated with the Primary Interop Assembly provided by Office, or you'll get a reference with a Visual Studio generated interop assembly.&amp;nbsp;Unfortuatnely, the VS generated interop assembly incorrectly maps some elements of the type library to elements in the interop assembly.&amp;nbsp; This ultimately means that when you are using this reference, you'll end up calling into a different property or method than your code appears to be calling, which causes various strange exceptions and errors.&lt;/P&gt;
&lt;P align=left&gt;You can easily determine which reference you are using by selecting the reference and looking at the properties of the reference. If you've added the self-generated IA reference, the properties will look like this:&lt;/P&gt;
&lt;P align=center&gt;&lt;A href="http://blogs.msdn.com/blogfiles/rgregg/WindowsLiveWriter/MysteriousErrorsWhenUsingFormRegionsfrom_F2A2/SolutionExplorer_IncorrectReference%5B9%5D.jpg" atomicselection="true" mce_href="http://blogs.msdn.com/blogfiles/rgregg/WindowsLiveWriter/MysteriousErrorsWhenUsingFormRegionsfrom_F2A2/SolutionExplorer_IncorrectReference%5B9%5D.jpg"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=240 src="http://blogs.msdn.com/blogfiles/rgregg/WindowsLiveWriter/MysteriousErrorsWhenUsingFormRegionsfrom_F2A2/SolutionExplorer_IncorrectReference_thumb%5B5%5D.jpg" width=460 border=0 mce_src="http://blogs.msdn.com/blogfiles/rgregg/WindowsLiveWriter/MysteriousErrorsWhenUsingFormRegionsfrom_F2A2/SolutionExplorer_IncorrectReference_thumb%5B5%5D.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P align=left&gt;Notice that the reference has "Copy Local" set to True, and that the Path is not pointing at the Global Assembly Cache (GAC) but rather to the location of my solution.&amp;nbsp; This indicates that I'm using a self-generated interop assembly, and that I may be running into issues.&lt;/P&gt;
&lt;P align=left&gt;If you've added the correct reference to the PIA, then you'll see properties that look like this instead:&lt;/P&gt;
&lt;P align=center&gt;&lt;A href="http://blogs.msdn.com/blogfiles/rgregg/WindowsLiveWriter/MysteriousErrorsWhenUsingFormRegionsfrom_F2A2/SolutionExplorer_CorrectReference%5B3%5D.jpg" atomicselection="true" mce_href="http://blogs.msdn.com/blogfiles/rgregg/WindowsLiveWriter/MysteriousErrorsWhenUsingFormRegionsfrom_F2A2/SolutionExplorer_CorrectReference%5B3%5D.jpg"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=240 src="http://blogs.msdn.com/blogfiles/rgregg/WindowsLiveWriter/MysteriousErrorsWhenUsingFormRegionsfrom_F2A2/SolutionExplorer_CorrectReference_thumb%5B1%5D.jpg" width=460 border=0 mce_src="http://blogs.msdn.com/blogfiles/rgregg/WindowsLiveWriter/MysteriousErrorsWhenUsingFormRegionsfrom_F2A2/SolutionExplorer_CorrectReference_thumb%5B1%5D.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P align=left&gt;This time around, you'll see the Path is pointing into the GAC, and the "Copy Local" property is False. This indicates the PIA is being used, and everything should work normally.&lt;/P&gt;
&lt;P align=left&gt;If you find your project is using the incorrect reference, you should remove the reference and add a new reference.&amp;nbsp; Unforutnately, there is no way to determine which reference is the "right" reference from the Add References dialog.&amp;nbsp; You'll simply need to use trial and error and double check after adding the resource to make sure you've picked the right one.&lt;/P&gt;
&lt;P align=left&gt;&lt;STRONG&gt;The Take-away:&lt;/STRONG&gt; Make sure you are using the right interop assembly when working with custom forms or form regions from your managed code solution.&amp;nbsp; Using the Visual Studio generated interop assembly can cause mysterious errors in your solution that you may not catch right away.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3448498" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/rgregg/archive/tags/Object+Model/default.aspx">Object Model</category><category domain="http://blogs.msdn.com/rgregg/archive/tags/Forms/default.aspx">Forms</category><category domain="http://blogs.msdn.com/rgregg/archive/tags/Outlook/default.aspx">Outlook</category><category domain="http://blogs.msdn.com/rgregg/archive/tags/.NET/default.aspx">.NET</category><category domain="http://blogs.msdn.com/rgregg/archive/tags/debugging/default.aspx">debugging</category><category domain="http://blogs.msdn.com/rgregg/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://blogs.msdn.com/rgregg/archive/tags/Common+Problems/default.aspx">Common Problems</category></item><item><title>Updated Samples for Outlook 2007 Developers</title><link>http://blogs.msdn.com/rgregg/archive/2007/02/14/updated-samples-for-outlook-2007-developers.aspx</link><pubDate>Wed, 14 Feb 2007 20:25:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1677620</guid><dc:creator>rgregg</dc:creator><slash:comments>7</slash:comments><comments>http://blogs.msdn.com/rgregg/comments/1677620.aspx</comments><wfw:commentRss>http://blogs.msdn.com/rgregg/commentrss.aspx?PostID=1677620</wfw:commentRss><wfw:comment>http://blogs.msdn.com/rgregg/rsscomments.aspx?PostID=1677620</wfw:comment><description>&lt;p&gt;Last week we uploaded revised versions of our sample code for Outlook 2007 add-ins.&amp;nbsp; The biggest change to these samples is that they are now provided as both a shared add-in project and VSTO 2005 SE project, so that you can see how add-in development would work using either technology.&lt;/p&gt; &lt;p&gt;These samples should give you a good basis for working with form regions, custom task panes, rules, the Table and PropertyAccessor objects, Ribbon extensibility and context menu customization.&lt;/p&gt; &lt;p&gt;You can download the latest samples from the following links:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/bb226712.aspx"&gt;Customizing the Ribbon in Outlook 2007&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/bb226710.aspx"&gt;Outlook 2007 Sample Add-ins: Rules Add-in, Travel Agency Add-in, and Prepare for Meeting Add-in&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1677620" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/rgregg/archive/tags/Object+Model/default.aspx">Object Model</category><category domain="http://blogs.msdn.com/rgregg/archive/tags/Forms/default.aspx">Forms</category><category domain="http://blogs.msdn.com/rgregg/archive/tags/Samples/default.aspx">Samples</category></item><item><title>Post B2TR Changes for Form Regions</title><link>http://blogs.msdn.com/rgregg/archive/2006/10/12/post-b2tr-changes-for-form-regions.aspx</link><pubDate>Thu, 12 Oct 2006 19:06:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:819914</guid><dc:creator>rgregg</dc:creator><slash:comments>24</slash:comments><comments>http://blogs.msdn.com/rgregg/comments/819914.aspx</comments><wfw:commentRss>http://blogs.msdn.com/rgregg/commentrss.aspx?PostID=819914</wfw:commentRss><wfw:comment>http://blogs.msdn.com/rgregg/rsscomments.aspx?PostID=819914</wfw:comment><description>&lt;p&gt;Shortly after we released Outlook 2007 beta 2 technical refresh to the world, we took a change on the Outlook platform to enable a new method of retrieving manifest and icon information for Outlook form regions.  The reason for this change was partially due to customer feedback we received during the beta, that add-in developers didn't like needing to write some files to the disk, while others could be included as resources.
&lt;/p&gt;&lt;p&gt;Unfortunately, this change required adding two additional methods to the &lt;em&gt;FormRegionStartup&lt;/em&gt; interface defined in the Outlook type library.  The end result of this change is that when the final version of Outlook 2007 is released, some solutions that compiled and ran against Outlook 2007 B2TR may need to be updated before they will compile against Outlook 2007 RTM.
&lt;/p&gt;&lt;p&gt;While you will need to update any solution that uses form regions in order to compile it against Outlook 2007 RTM, existing solutions that were previously compiled should continue to run successfully on the RTM build even with this change.  The additional functions were added to the end of the interface VTable and thus won't interfere with the existing methods provided in B2TR.
&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Using the New Methods&lt;/strong&gt;
	&lt;/p&gt;&lt;p&gt;The two new methods added in the RTM builds are:
&lt;/p&gt;&lt;ul&gt;&lt;li&gt;public object GetFormRegionManifest(string FormRegionName, int LCID)
&lt;/li&gt;&lt;li&gt;public object GetFormRegionIcon(string FormRegionname, int LCID, Outlook.OlFormRegionIcon Icon)
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;em&gt;GetFormRegionManifest&lt;/em&gt; expects a string containing the manifest XML to be the return value.  If anything else is provided, the form region will not load.
&lt;/p&gt;&lt;p&gt;&lt;em&gt;GetFormRegionIcon&lt;/em&gt; can return either a byte-array that represents the original bytes of the image file, or an &lt;em&gt;IPictureDisp&lt;/em&gt; object.  For more information on how to convert a .NET &lt;em&gt;Image&lt;/em&gt; or &lt;em&gt;Bitmap&lt;/em&gt; over to &lt;em&gt;IPictureDisp&lt;/em&gt;, check out &lt;a href="http://blogs.msdn.com/vsto/archive/2004/02/10/70691.aspx"&gt;this article on the VSTO blog&lt;/a&gt;.
&lt;/p&gt;&lt;p&gt;Outlook will only call these methods on the interface if we find a the registry entry that previously was required to point to a file path or include inline XML now contains the ProgID of an add-in installed in Outlook, prefixed with an equal sign (=).  For example, if your add-in was named "OutlookAddin1.Connect", you could write the following value in the registry: "=OutlookAddin1.Connect" and Outlook would then call these functions to request the manifest information for the form region.
&lt;/p&gt;&lt;p&gt;These are a few changes worthy of pointing out when using this method:
&lt;/p&gt;&lt;ul&gt;&lt;li&gt;The &amp;lt;name&amp;gt;, &amp;lt;layoutFile&amp;gt;, and &amp;lt;addin&amp;gt; elements of the form region manifest are ignored when provided via &lt;em&gt;GetFormRegionManifest&lt;/em&gt;.  The form region name is the name of the registry value for the form region, and we already know the ProgID of the add-in. 
&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Child elements of the &amp;lt;icons&amp;gt; element should either be empty elements (like &amp;lt;page/&amp;gt;) or should contain the word "addin" if Outlook should call &lt;em&gt;GetFormRegionIcon&lt;/em&gt; for that icon.  When the add-in provides the manifest, all icons must be provided via &lt;em&gt;GetFormRegionIcon&lt;/em&gt; and cannot be pointers to a file path.
&lt;/p&gt;&lt;p&gt;If you have any questions about the behavior of these new methods, please comment on this post.  I'd like to make sure that this isn't a big surprise for anyone working in the form region space when we ship Outlook 2007.  I'll also be updating our form region samples to implement and use this new method when we release the RTM versions of our sample code.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=819914" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/rgregg/archive/tags/Object+Model/default.aspx">Object Model</category><category domain="http://blogs.msdn.com/rgregg/archive/tags/Forms/default.aspx">Forms</category></item><item><title>Third Party Add-ins and Outlook 2007</title><link>http://blogs.msdn.com/rgregg/archive/2006/09/11/749882.aspx</link><pubDate>Mon, 11 Sep 2006 23:38:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:749882</guid><dc:creator>rgregg</dc:creator><slash:comments>9</slash:comments><comments>http://blogs.msdn.com/rgregg/comments/749882.aspx</comments><wfw:commentRss>http://blogs.msdn.com/rgregg/commentrss.aspx?PostID=749882</wfw:commentRss><wfw:comment>http://blogs.msdn.com/rgregg/rsscomments.aspx?PostID=749882</wfw:comment><description>&lt;p&gt;While we spend a great deal of time and effort to ensure that the Outlook platform is 100% backwards compatible with previous versions of Outlook, occasionally add-ins do something unexpected, or use the platform in an unexpected or undocumented way.&amp;nbsp; These add-ins can misbehave and cause problems when running against a new version of Outlook (such as Outlook 2007) where they have not been fully tested by the software developer.&lt;/p&gt; &lt;p&gt;Many beta testers found this out the hard way during the Office beta 2 release when some very popular add-ins caused Outlook to crash unexpectedly while sending mail or performing other common tasks.&lt;/p&gt; &lt;p&gt;I've been working closely with a number of ISVs and software developers to ensure that these problems are fixed correctly.&amp;nbsp; Sometimes we've broken the way something works and we have to fix it on the Outlook side.&amp;nbsp; Sometimes the problem lies in the way the add-in works and the add-in needs to be updated.&amp;nbsp; Often this means that the end user needs to disable the add-in until a new version is available.&lt;/p&gt; &lt;p&gt;Because add-in release cycles are not necessarily tied to Office/Outlook releases, this can cause a problem for some users.&amp;nbsp; In the interim between when a new version of Outlook is released and add-ins are updated, you may need to disconnect an add-in to continue to use Outlook effectively.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;To&amp;nbsp;Disconnect an Misbehaving Add-in:&lt;/strong&gt;&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Start Outlook.&amp;nbsp; If you cannot start Outlook because an add-in is causing it to crash immediately, you should be prompted to disable the add-in (in B2TR or later builds), otherwise use the command line &lt;em&gt;outlook.exe /safe&lt;/em&gt; to boot in safe mode.  &lt;li&gt;From the Outlook window, select the &lt;strong&gt;Tools &lt;/strong&gt;menu, and then &lt;strong&gt;Trust Center&lt;/strong&gt;.  &lt;li&gt;Click on the &lt;strong&gt;Add-ins&lt;/strong&gt; tab, and then click the &lt;strong&gt;Go&lt;/strong&gt; button at the bottom of the page.  &lt;li&gt;Disable one or more third party add-ins listed in the dialog.&amp;nbsp; If you were directed here from a crash report, you should have seen information on which add-in was responsible for the crash.&amp;nbsp; Find that add-in and uncheck the box next to the add-in. &lt;li&gt;Click &lt;strong&gt;OK&lt;/strong&gt;.  &lt;li&gt;Restart Outlook.&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;&lt;strong&gt;To Enable a Disabled Add-in:&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;If you're a developer working on an add-in, and Outlook has disabled it, or you are a user who wants to try an add-in again that was previously disabled, you need to access the Disabled Items dialog to enable the add-in.&amp;nbsp; While you can access this from the Trust Center via the Add-ins tab, the easiest way in Outlook is to select the &lt;strong&gt;Help &lt;/strong&gt;menu, then &lt;strong&gt;Disabled Items&lt;/strong&gt;.&amp;nbsp; Find the add-in on the list of disabled items, select it, and click the &lt;strong&gt;Enable&lt;/strong&gt; button to enable the add-in again.&lt;/p&gt; &lt;p&gt;Keep in mind that if the add-in was disabled, it's likely because Outlook believes the add-in is misbehaving.&amp;nbsp; There are some add-ins that are disabled immediately when Outlook is installed, and others that are disabled because Outlook detected a problem.&amp;nbsp; In all cases, you should only enable an add-in again if you are sure that it is not causing any problems in Outlook.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Technical Details for Changes in Beta 2 Technical Refresh&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;If you aren't a developer or a technophile, I suggest you skip this part.&lt;/p&gt; &lt;p&gt;In response to a number of third party problems we've seen during the Beta 2 release of Outlook, we've made a change to the add-in resiliency logic that Outlook uses.&amp;nbsp; Early in the Outlook 2007 release cycle, we decided to make a change to the way Outlook handles errors from installed add-ins.&amp;nbsp; Previously Outlook would catch exceptions from add-ins and silently ignore them.&amp;nbsp; This prevented Outlook from crashing immediately, but Outlook usually would crash later because memory somewhere had become corrupted, and it was just a matter of time before this caused a problem.&amp;nbsp; For Outlook 2007, we now crash immediately when the add-in throws an error, allowing us to better understand the root cause of the failure.&amp;nbsp; Instead of crashing later in some random code, we now crash at the actual cause.&amp;nbsp; However, this change caused Outlook to crash a lot more frequently due to a number of add-ins that expected to be able to throw exceptions without consequence (which is a really bad expectation).&lt;/p&gt; &lt;p&gt;Previously in Outlook 2003, if an add-in caused Outlook to crash while the add-in was being initialized (OnConnection) or disconnected (OnDisconnection), then the add-in could be added to the disabled items list, which prevents the add-in from being loaded or running.&amp;nbsp; If an add-in crashed later, say in an event handler (the most common place we saw crashes in beta 2), then Outlook would crash, and the add-in would not be disabled.&amp;nbsp; This meant that it was possible to have a very bad experience in Outlook where every time Outlook boots, it crashes due to a misbehaving add-in.&amp;nbsp; The only recourse was to use safe mode to disable the add-in, which most users would not immediately discover.&lt;/p&gt; &lt;p&gt;Now, in B2TR Outlook will also perform the same resiliency action if the add-in causes Outlook to crash during an event handler.&amp;nbsp; Outlook will still crash, but upon the next boot of Outlook, you will be presented with a dialog asking if you want to disable the add-in.&amp;nbsp; This way, users who are seeing a large number of add-in related crashes in beta 2 should only see a couple of crashes in beta 2 technical refresh because the add-in can be disabled easily by the user (and we default to disable if the user accepts the prompt defaults).&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=749882" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/rgregg/archive/tags/Object+Model/default.aspx">Object Model</category><category domain="http://blogs.msdn.com/rgregg/archive/tags/General/default.aspx">General</category></item><item><title>Blog Q&amp;A</title><link>http://blogs.msdn.com/rgregg/archive/2006/09/02/737148.aspx</link><pubDate>Sun, 03 Sep 2006 01:43:26 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:737148</guid><dc:creator>rgregg</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/rgregg/comments/737148.aspx</comments><wfw:commentRss>http://blogs.msdn.com/rgregg/commentrss.aspx?PostID=737148</wfw:commentRss><wfw:comment>http://blogs.msdn.com/rgregg/rsscomments.aspx?PostID=737148</wfw:comment><description>&lt;p&gt;A while back while I was taking about forms, I got a number of questions from readers out there in web land who wanted to know more detailed answers to some questions.  I haven't been ignoring you, I promise, but we've been super busy getting Office 2007 beta 2 technical refresh ready for public consumption.  Now that the B2TR bits are basically done, I've got a few free minutes to get back to answering questions and blogging in general.
&lt;/p&gt;&lt;p&gt;Previously I was discussing some of the new forms technologies in Outlook we've dubbed 'form regions'.  Form regions are designed to make it easier to do the kinds of UI customizations most developers have been trying to accomplish without the overhead involved in redesigning an entire Outlook form and worrying about how to publish it to Outlook.  While I was on that subject, I got a number of questions, which I will now answer.
&lt;/p&gt;&lt;p&gt;[Note, some of these questions have been edited to be more concise (or to actually be questions)]
&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Q: Is there a future for the Outlook view control (OVC)?  If there is, include it with Outlook and make it easier to work with.&lt;/strong&gt;
	&lt;/p&gt;&lt;p&gt;Well, the short answer here is that the control is of course still shipping in Outlook 2007.  However, we did not make any significant investments to the OVC for this release.  The OVC has been included as part of the Outlook installation since Outlook XP (for Outlook 2000 it was a web download).  We are evaluating the needs of our platform and how we can improve the OVC, so if you have any scenarios you are trying to accomplish today where the OVC is falling short, please let us know.
&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Q: Have the form controls been improved?&lt;/strong&gt;
	&lt;/p&gt;&lt;p&gt;Totally.  We realized very early on in the 2007 release that our forms were starting to look dated and we needed to clean up their appearance.  As part of the form region effort we created new Outlook controls (Olk* in the type library) that are more modern versions of the form controls previously available for custom forms.  We also created a bunch of new controls that provide functionality available in Outlook, like the business card preview, date/time pickers, info bar, category, and page controls.  These new controls when used on form regions enable a form designer/developer to really replicate the look and feel of the Outlook interface without needing to clone the interface in your own custom controls.
&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Q: Is the IDE for form script any better?&lt;/strong&gt;
	&lt;/p&gt;&lt;p&gt;While we haven't improved or changed the script editor component that is used for 'legacy' custom forms, form regions are built using a whole new model.  Instead of writing code inside Outlook that is embedded as part of the form, form regions rely on an add-in to provide the business logic behind a form region.  This means that you can use your favorite programming language and IDE as long as they support building a COM add-in.  With form regions you can use whatever language you prefer to back your form.  You can read more about how to make this happen in my MSDN article "&lt;a href="http://msdn2.microsoft.com/en-us/library/ms788695.aspx"&gt;Building an Outlook 2007 Form Region with a Managed Add-In&lt;/a&gt;".  We're also working closely with the Visual Studio Tools for Office (VSTO) team to further improve the story for the Orcas release, but details of what may be available in this release are still TBD.
&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Q: How do you envision people debugging code on forms?&lt;/strong&gt;
	&lt;/p&gt;&lt;p&gt;Script debugging has been a painful process for forms developers.  Fortunately, since Outlook 2007 form regions no longer use script, but instead use an add-in, the debugging experience is much improved.  You can debug a form region in exactly the same way you would debug an Outlook COM add-in, using Visual Studio or another IDE.  Just attach to Outlook (or just run your project if you are using a VSTO-based add-in), insert breakpoints, watches, etc, and wait for an error to occur.  If you're using Visual Studio 2005 and managed code for your add-in, you can even do edit-and-continue, just like with other managed code.
&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Q: Do you see people continuing to use Public folders?
&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;I think it should be clear that public folders will continue to play a role in the short term future. However, if you look at the direction Exchange 12 is moving, you'll see public folders are now an optional component to the Exchange system.  For Outlook 2007 we've converted a lot of features that used to rely on public folders over to using web services or found other mechanisms for replacing the functionality of public folders. Custom solutions that depend on public folders will need to start being migrated over to other technologies as well, because public folders are a legacy technology that are on the way out.  Using SharePoint may be one good way of migrating a solution, but other alternatives as also available.  One of the reasons we developed the form region technology was to allow organizations to have form solutions that didn't depend on the Organizational Forms Library (which uses public folders) and still be able to relatively easily deploy forms across an organization. 
&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt;
		&lt;strong&gt;Was work put into improving custom forms management/deployment?
&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Outlook 2007 maintains the functionality provided by Outlook 2003 for custom forms management and deployment via Outlook.  However, our form regions are designed to work differently.  Instead of using a forms library that needs to managed inside Outlook, form regions are registered via the Windows registry and XML-based manifest files.  For deployment, form regions are designed to use any installer technology you might use for an Outlook add-in, such as Windows Installer (MSI) or ClickOnce deployment.  Since form regions are tied closely with add-ins, they do not live in the forms cache and are not subject to the issues around forms cache corrupt that occasionally caused issues for our custom forms in the past.
&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt;
		&lt;strong&gt;OWA/Mobile. Design once, run everywhere is a definite necessity, will this story be improved?
&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;For Outlook 2007 this story remains unchanged.  There are some big issues to face, like how a form that looks good for a desktop client can be useful on a mobile device with a much smaller screen or as a web form.  There are also issues around the replication of properties between desktop Outlook and mobile devices. However, I believe these are solvable problems, and for the next release of Outlook I hope we can spend some time in this space and improve the story over what we currently offer.
&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Q: Is WYSIWYG forms printing supported in Outlook 2007?&lt;/strong&gt;
	&lt;/p&gt;&lt;p&gt;Outlook 2007 still maintains the status quo for printing support of custom forms.  However, there are a few third party solutions available for Outlook 2003 that provides this support, and it's definitely something that a form developer can implement using a few Windows APIs.  I hope for the next release that we can address this concern and improve the support for printing custom forms.
&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Q: Progress and Excitement. Do you think there is a REAL commitment within the Outlook team for extensibility?
&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;There is a very real commitment on the Outlook team for extensibility.  For Outlook 2007 we've actually doubled the number of classes defined in the Outlook type library, flushing out a huge range of new functionality that previously wasn't available.  For the next release we're already looking into how we can continue to expand on what we've done in this release and make the platform easier to work with and friendly for developers, and also allow developers to do more with Outlook.  For Outlook 2007 we've had two program managers and a team of developers and testers working to improve the object model, so we are definitely committed to improving extensibility.  Randy Byrne and I are also working on a new Outlook programmability book which we hope to have available close shortly after Office 2007 is available.
&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Q: Other questions relating to Exchange extensibility.&lt;/strong&gt;
	&lt;/p&gt;&lt;p&gt;Unfortunately I'm rather disconnected from what is going on over in Exchange extensibility.  I'll have to follow up in another post on these questions.  In the mean time, readers may want to direct those questions to the Exchange team blog, "&lt;a href="http://msexchangeteam.com/"&gt;You had me at EHLO&lt;/a&gt;".
&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;That's it for the questions I have right now.  I've got a few other blog topics I hope to get to shortly, but as usual my time is scarce.  I hope to be more prolific with my posts in the near future, especially as the beta 2 technical refresh becomes available.  In the mean time, I hope you have a great Labor Day weekend! &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=737148" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/rgregg/archive/tags/Object+Model/default.aspx">Object Model</category><category domain="http://blogs.msdn.com/rgregg/archive/tags/Forms/default.aspx">Forms</category></item><item><title>Outlook Shutdown and COM Add-ins</title><link>http://blogs.msdn.com/rgregg/archive/2006/06/27/OutlookShutdownAndCOMAddins.aspx</link><pubDate>Tue, 27 Jun 2006 18:20:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:648561</guid><dc:creator>rgregg</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/rgregg/comments/648561.aspx</comments><wfw:commentRss>http://blogs.msdn.com/rgregg/commentrss.aspx?PostID=648561</wfw:commentRss><wfw:comment>http://blogs.msdn.com/rgregg/rsscomments.aspx?PostID=648561</wfw:comment><description>&lt;P&gt;Depending on how familiar you are with Outlook development, you may have seen previous versions of Outlook occasionally had a problem shutting down. Often there could be a catch-22 situation, where the add-in was waiting to hear from Outlook that it should clean up its references, and Outlook was waiting for these references to be released before notifying the add-ins that it was shutting down. In previous versions, Outlook only paid attention to the number of references for the OM objects, and not if those references were held by add-ins. &lt;/P&gt;
&lt;P&gt;For Outlook 2007, our developers spent time investigating the problem, and came up with a fix that has caused the shutdown issues for Outlook to largely disappear, even when running managed code add-ins. There are, of course, a few limitations to what can be done, so it's important that Outlook add-in developers understand what this work buys them and what they still need to do to ensure an add-in solution doesn't keep Outlook alive. &lt;/P&gt;
&lt;P&gt;Outlook now keeps track of references which it knows were handed out to an Outlook add-in. References provided to an add-in and those derived from objects provided to an add-in are tagged as belonging to that particular add-in. When the UI is closed and the only remaining references are tagged as blonging to add-ins, Outlook will shutdown. If a reference tagged for an add-in is marshaled out to another process, these references can be disconnected from under the application when Outlook shuts down. &lt;/P&gt;
&lt;P&gt;There are a few scenarios through which Outlook can lose track of an add-in reference on an object. For instance, accessing Outlook objects through non-Outlook libraries, such as returning a reference to the Application object through the command bars OM (accessing properties like Application or Parent), can cause the context to be lost. We've done work to improve the way this works with some new Office APIs to make sure that the context is not lost. For example, when working with the ribbon UI integration, objects provided in ribbon callback methods will still be in the context of the add-in. Likewise, using the new Custom Task Pane OM provided by Office will not get you in trouble either. &lt;/P&gt;
&lt;P&gt;Another possible scenario is if the add-in creates a new instance of the Application object (new Application() or calling CoCreateInstance) and then marshal this object (or derived objects) to another process or thread. Outlook will be unable to track these objects as belonging to an Outlook add-in. When the reference is marshaled to become a strong external reference, Outlook will not shut down properly until the reference is cleaned up. Technically speaking, Outlook will remain alive if there are external connections registered through the &lt;A href="http://windowssdk.msdn.microsoft.com/en-us/library/ms680082.aspx"&gt;IExternalConnection&lt;/A&gt; interface of COM on any OM objects. &lt;/P&gt;
&lt;P&gt;These changes to our shutdown logic apply only to add-ins and internal references. The behavior for COM callers outside of the Outlook process space hasn't changed. Programs that CoCreateInstance the Outlook Application object can expect that Outlook will remain alive, even if the user attempts to quit the process, until those references are released as long as these references appear to be external connections to Outlook. &lt;/P&gt;
&lt;P&gt;The benefit of these changes should be pretty clear: COM add-ins will no longer need to implement some kind of shut down workaround which was previously a popular sight in any Outlook add-in code. The change also lowers the bar to writing a COM add-in that doesn't break Outlook. New Outlook developers won't need to know about any sort of hacks or workarounds to make sure Outlook shuts down in the appropriate way. They can rely on seeing the OnBeginShutdown and OnDisconnection methods be called as Outlook prepares to shutdown and actually shuts down. &lt;/P&gt;
&lt;P&gt;Final note: Developers shouldn't use this as an opportunity to be lazy though. You should continue to write clean code that properly cleans up and releases your references whenever the add-in has finished using that object. Cleaning up references to Outlook objects is important for memory utilization and performance implications. Each OM object reference kept alive also requires Outlook to keep the internal representation of that item alive, including any server connections required by that object. This can produce exceptions under unexpected conditions that can be avoided by properly releasing these objects when the add-in is finished with the object.&lt;/P&gt;&lt;/SPAN&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=648561" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/rgregg/archive/tags/Object+Model/default.aspx">Object Model</category></item><item><title>Using VSTO v3 CTP with Outlook 2007</title><link>http://blogs.msdn.com/rgregg/archive/2006/04/05/569300.aspx</link><pubDate>Wed, 05 Apr 2006 23:26:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:569300</guid><dc:creator>rgregg</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/rgregg/comments/569300.aspx</comments><wfw:commentRss>http://blogs.msdn.com/rgregg/commentrss.aspx?PostID=569300</wfw:commentRss><wfw:comment>http://blogs.msdn.com/rgregg/rsscomments.aspx?PostID=569300</wfw:comment><description>&lt;P&gt;If you are excited about managed add-in development and Outlook 2007, you've no doubt heard about the CTP release for VSTO v3 (VSTO is Visual Studio Tools for Office).&amp;nbsp; This release enables developers to start working with managed code add-ins using the VSTO environment and targeting Outlook 2007.&lt;/P&gt;
&lt;P&gt;Of course, this VSTO release is very early in the cycle and not all of the features are code complete or event included yet.&amp;nbsp; This release is primarily targeting the runtime environment and making sure that things work.&amp;nbsp; The side effect of this is that some extra "glue" is required to use some features.&amp;nbsp; Andrew has a nice post over on his blog about &lt;A HREF="/andreww/archive/2006/04/04/568607.aspx"&gt;how to use Form Regions with VSTO v3&lt;/A&gt;, so if you are interested I'd suggest you take a look.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=569300" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/rgregg/archive/tags/Object+Model/default.aspx">Object Model</category></item><item><title>Outlook form regions</title><link>http://blogs.msdn.com/rgregg/archive/2006/03/26/561358.aspx</link><pubDate>Sun, 26 Mar 2006 19:54:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:561358</guid><dc:creator>rgregg</dc:creator><slash:comments>7</slash:comments><comments>http://blogs.msdn.com/rgregg/comments/561358.aspx</comments><wfw:commentRss>http://blogs.msdn.com/rgregg/commentrss.aspx?PostID=561358</wfw:commentRss><wfw:comment>http://blogs.msdn.com/rgregg/rsscomments.aspx?PostID=561358</wfw:comment><description>&lt;p&gt;Outlook 2007 includes a new way of customizing the Outlook user interface for data in Outlook.&amp;nbsp; If you have used previous versions of Outlook and had a need to customize our forms, you know that in the past custom forms in Outlook were a bit of a challenge.&lt;/p&gt;
&lt;p&gt;If you were interested in working with any built-in form other than the mail, post, or contact forms, you were limited to adding additional tab pages to the standard page.&amp;nbsp; Even if you were interested in customizing the contact form, you couldn't replicate the look and feel of the standard Outlook form.&amp;nbsp; Custom forms were also never displayed in the Reading Pane, which is how a lot of users work in their mailbox.&amp;nbsp; Additionally, once you had a form designed, to write code behind the form for business logic and validation you were stuck using notepad.&amp;nbsp; Finally, after the form was working just the way you wanted, the Outlook forms cache could swallow the form and Outlook would end up just using the standard form anyway.&lt;/p&gt;
&lt;div style="PADDING-RIGHT: 2px; PADDING-LEFT: 2px; FLOAT: right; PADDING-BOTTOM: 2px; PADDING-TOP: 2px; TEXT-ALIGN: center"&gt;&lt;a href="http://officeblogs.net/rgregg/MailInspector.png"&gt;&lt;img alt="Example of an adjoining region" src="http://officeblogs.net/rgregg/AdjoiningRegion_thumb1.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;b&gt;An adjoining region in a mail note&lt;/b&gt; &lt;/div&gt;Because of these issues, for Outlook 2007 we introduced a new mechanism for form customization we've named "form regions".&amp;nbsp; Our goal was pretty simple: reduce the difficulty for doing simple customizations on the one hand, while ensuring that rich integrations could reproduce the look and feel of Outlook built-in forms without major compromises.&amp;nbsp; To this end, Outlook 2007 supports two types of form region customizations: adjoining regions and separate regions: 
&lt;p&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Adjoining regions enable you to provide purely additive "regions" to the bottom of the first tab of an existing form (custom or built-in).&amp;nbsp; These regions are also, optionally, displayed in the Reading Pane of Outlook.&amp;nbsp; For instance, if you want to add a few additional fields to a built-in Outlook form, an adjoining region would be a good approach.&lt;/li&gt;
&lt;li&gt;Separate regions can either be added to an existing form, or they can replace one or all of the tabs on an existing form.&amp;nbsp; If the solution requires that the entire form be customized, or if you would like to add data into the middle of an existing form, or on a separate form page, then separate regions are a good choice.&amp;nbsp; Separate regions that replace the first form page are also displayed in the Reading Pane of Outlook.&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div style="PADDING-RIGHT: 2px; PADDING-LEFT: 2px; FLOAT: left; PADDING-BOTTOM: 2px; WIDTH: 200px; PADDING-TOP: 2px; TEXT-ALIGN: center"&gt;&lt;a href="http://officeblogs.net/rgregg/PreviewPane.jpg"&gt;&lt;img alt="Outlook form regions work in the reading pane as well." src="http://officeblogs.net/rgregg/PreviewPane_thumb1.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;b&gt;Form regions work in the reading pane as well&lt;/b&gt;&lt;/div&gt;
&lt;p&gt;Outlook 2007 also includes a number of new form controls that provide the business logic and behavior users expect from Outlook forms.&amp;nbsp; We've included a contact photo control, date and time picker controls, Electronic Business Card preview control, and several others so that custom forms can finally have parity with our built-in forms.&amp;nbsp; We've also made sure that all of the included forms controls support Windows themes.&amp;nbsp; No longer will your custom forms look like they were made in 1995.&lt;/p&gt;
&lt;p&gt;Another benefit of Form Regions is that instead of writing your code in notepad and VBScript, form regions are designed to be driven with an add-in.&amp;nbsp; Thus, you can work in your favorite development environment and take advantage of all the features it provides.&amp;nbsp; You just implement a new interface, FormRegionStartup, and your form will be off and running in no time.&amp;nbsp; You can listen for a full range of events on the controls, monitor other Outlook data and respond accordingly, and retrieve data from non-Outlook sources for displaying on your form region, all from the comfort of your favorite programming language.&lt;/p&gt;
&lt;p&gt;Because of the close connection to an add-in, Outlook form regions are installed as part of your add-in, thus simplifying the deployment model for Outlook customizations.&amp;nbsp; Your add-in setup project just needs to write an XML manifest that describes the region to the registry or the local disk, and then register that manifest with Outlook.&amp;nbsp; When Outlook is ready to display your form region, it will call back on the FormRegionStartup interface to ask your add-in for all the details.&amp;nbsp; Installing your form locally with the add-in also means that form regions will continue to work in the same way even when running against an Exchange server without public folders.&lt;/p&gt;
&lt;p&gt;With beta 1 and beta 1 technical refresh, the Outlook team has released a sample named "Travel Agency" which provides an example of a separate form region customizing the Outlook contact form with an additional&amp;nbsp;form page.&amp;nbsp; These samples have been posted on Beta Place for you to download and try out.&amp;nbsp; Starting with beta 2, we will have an updated sample that includes an adjoining region as well.&lt;/p&gt;
&lt;p&gt;I'd really encourage the developers out there to try out this new UI customization.&amp;nbsp; Download the samples and check out what you can do.&amp;nbsp; If you caught some of the MIX06 conference, you may have noticed the Outlook/EBay add-in, which was also built using Outlook form regions.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=561358" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/rgregg/archive/tags/Object+Model/default.aspx">Object Model</category></item><item><title>New code samples available for download</title><link>http://blogs.msdn.com/rgregg/archive/2006/01/17/513904.aspx</link><pubDate>Tue, 17 Jan 2006 22:06:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:513904</guid><dc:creator>rgregg</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/rgregg/comments/513904.aspx</comments><wfw:commentRss>http://blogs.msdn.com/rgregg/commentrss.aspx?PostID=513904</wfw:commentRss><wfw:comment>http://blogs.msdn.com/rgregg/rsscomments.aspx?PostID=513904</wfw:comment><description>&lt;P&gt;If you’re an Outlook developer who has been excited to hear about all of the cool new work done for Outlook 12 but didn’t know where to begin, I now have an answer for you.&amp;nbsp; We’ve finally (sorry for the delay) posted 3 sample add-ins to BetaPlace.&amp;nbsp; These add-ins will help you learn by example how to use some of the great new extensibility features of Outlook 12.&amp;nbsp; All three add-ins are written in managed code, but without using VSTO as an Office 12 compatibility version of VSTO has not yet been released.&lt;/P&gt;
&lt;P&gt;We took the extra step of releasing all three add-ins in both C# and VB based on feedback from the labs at PDC indicating samples in C# weren’t helpful for those VB developers out there.&amp;nbsp; We plan to continue releasing the sample code in both languages.&lt;/P&gt;
&lt;P&gt;These three add-ins were available on BetaPlace starting on Monday:&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P&gt;&lt;STRONG&gt;Prepare Me Add-in&lt;BR&gt;&lt;/STRONG&gt;The Prepare Me add-in showcases the new Custom Task Pane technology that has been included as part of Outlook 12.&amp;nbsp; The Prepare Me add-in provides a task pane to help prepare for meetings on your calendar by showing information about the attendees, recent mail items from each attendee, and quick links to related meetings and items assigned to the same categories.&amp;nbsp; If you did the PDC 2005 hands on lab for Outlook this add-in should be familiar to you.&amp;nbsp; For Beta 1 we’ve updated the add-in to include support for the new UI in Outlook inspector windows.&amp;nbsp; Prepare Me also demonstrates the usage of the table, property accessor, context menu customization, programmatic search, categories, and exchange user.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Rules Add-in&lt;BR&gt;&lt;/STRONG&gt;The Rules add-in show how easy it can be to replace Outlook UI to provide a custom experience for a user.&amp;nbsp; In this case the add-in repurposes the “Create Rule” context menu entry point with a WinForms dialog that supports creating custom rules for the selected item.&amp;nbsp; This add-in makes use of the rules object model, property accessor, context menus, and the select names dialog.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Travel Agency Add-in&lt;/STRONG&gt;&lt;BR&gt;The Travel Agency add-in is an example solution demonstrating Outlook’s new Form Regions.&amp;nbsp; This add-in displays adds a “Booking” page to the contact inspector&amp;nbsp; that allows travel preference information to be associated with each contact.&amp;nbsp; Additional the extra tab allows for viewing and creating new travel itineraries for the selected contact.&amp;nbsp; Behind this region business logic and itinerary processing code lives in a Outlook add-in running behind the form.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I hope all the Outlook developers out there take a look at these samples and start to learn how to use the next extensibility features of Outlook 12.&amp;nbsp; There is a lot more still available that we haven’t shown off yet, so please play around too.&amp;nbsp; If you have any questions about the samples or getting them to work, post on the Office 12 beta newsgroups or send me a comment here.&lt;BR&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=513904" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/rgregg/archive/tags/Object+Model/default.aspx">Object Model</category></item></channel></rss>