<?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>Office Development with Visual Studio : Office Development</title><link>http://blogs.msdn.com/vsto/archive/tags/Office+Development/default.aspx</link><description>Tags: Office Development</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Migrating an Outlook Solution to .NET Framework 4 in Visual Studio 2010 (Norm Estabrook)</title><link>http://blogs.msdn.com/vsto/archive/2009/12/16/migrating-an-outlook-solution-to-net-framework-4-in-visual-studio-2010-norm-estabrook.aspx</link><pubDate>Wed, 16 Dec 2009 22:33:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9937915</guid><dc:creator>VSTO Team</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/vsto/comments/9937915.aspx</comments><wfw:commentRss>http://blogs.msdn.com/vsto/commentrss.aspx?PostID=9937915</wfw:commentRss><description>&lt;p&gt;Visual Studio can help migrate your Outlook solutions from .NET Framework 3.5 to the .NET Framework 4. However, you still have to do a few things manually to make it all work.&amp;#160; &lt;/p&gt;  &lt;p&gt;Beth Massi converts an Outlook Solution that targets the .NET Framework 3.5 to an Outlook Solution that targets the .NET Framework 4 client profile in this very cool and informative blog entry - &lt;a href="http://blogs.msdn.com/bethmassi/archive/2009/12/15/migrating-an-outlook-client-to-net-framework-4-in-visual-studio-2010.aspx"&gt;Migrating an Outlook Client to .NET Framework 4 in Visual Studio 2010&lt;/a&gt;. &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9937915" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/vsto/archive/tags/Outlook+2007/default.aspx">Outlook 2007</category><category domain="http://blogs.msdn.com/vsto/archive/tags/VSTO/default.aspx">VSTO</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Norm+Estabrook/default.aspx">Norm Estabrook</category><category domain="http://blogs.msdn.com/vsto/archive/tags/.NET+Framework+Client+Profile/default.aspx">.NET Framework Client Profile</category><category domain="http://blogs.msdn.com/vsto/archive/tags/migration/default.aspx">migration</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Beth+Massi/default.aspx">Beth Massi</category><category domain="http://blogs.msdn.com/vsto/archive/tags/VS2010/default.aspx">VS2010</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Office+Development/default.aspx">Office Development</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Visual+Studio+2010/default.aspx">Visual Studio 2010</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Office+2010/default.aspx">Office 2010</category></item><item><title>Making a Custom Group Appear in the Message Tab of a Mail Item (Norm Estabrook)</title><link>http://blogs.msdn.com/vsto/archive/2009/12/15/making-a-custom-group-appear-in-the-message-tab-of-a-mail-item-norm-estabrook.aspx</link><pubDate>Tue, 15 Dec 2009 22:14:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9937317</guid><dc:creator>VSTO Team</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/vsto/comments/9937317.aspx</comments><wfw:commentRss>http://blogs.msdn.com/vsto/commentrss.aspx?PostID=9937317</wfw:commentRss><description>&lt;p&gt;You can add a custom group to the &lt;strong&gt;Message&lt;/strong&gt; tab of an Outlook mail item.&amp;#160; For example, here is a custom group named &amp;quot;MyCoolGroup&amp;quot; that I added to the message tab of a new message:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/DisplayingaCustomGroupinBoththeOutlookMa_D2A0/image_9.png" mce_href="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/DisplayingaCustomGroupinBoththeOutlookMa_D2A0/image_9.png"&gt;&lt;img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/DisplayingaCustomGroupinBoththeOutlookMa_D2A0/image_thumb_3.png" width="674" height="227" mce_src="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/DisplayingaCustomGroupinBoththeOutlookMa_D2A0/image_thumb_3.png" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Outlook lets you open a message in the following two modes: &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Compose (you are drafting a new message). &lt;/li&gt;    &lt;li&gt;Read (you are reading a message).&amp;#160; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Making a custom group appear for only one of these modes is pretty easy.&amp;#160; Making it appear for both modes is a tad more challenging. That is because the control ID of the &lt;strong&gt;Message&lt;/strong&gt; tab in read mode is different than the control ID of the &lt;strong&gt;Message&lt;/strong&gt; tab in compose mode. When you design your custom group in the VSTO Ribbon designer, you can only specify &lt;strong&gt;one&lt;/strong&gt; control ID. This means that when you run the project, the custom group will only appear in the &lt;strong&gt;Message&lt;/strong&gt; tab of a compose window or the &lt;strong&gt;Message&lt;/strong&gt; tab of a read window depending on which control ID you specify at design-time. &lt;/p&gt;  &lt;p&gt;If you want the group to appear in both versions of the &lt;strong&gt;Message&lt;/strong&gt; tab (read and compose), you have to do a bit more work. Here is how you make the group appear for both modes:&lt;/p&gt;  &lt;p&gt;First, add a &lt;strong&gt;Ribbon (Visual Designer)&lt;/strong&gt; to an Outlook 2007 add-in project.&lt;/p&gt;  &lt;p&gt;Then, set the &lt;strong&gt;RibbonType&lt;/strong&gt; property of the Ribbon to &lt;strong&gt;Microsoft.Outlook.Mail.Read&lt;/strong&gt; as follows:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/DisplayingaCustomGroupinBoththeOutlookMa_D2A0/image_10.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/DisplayingaCustomGroupinBoththeOutlookMa_D2A0/image_thumb.png" width="283" height="393" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;On the Ribbon designer, add a group to a tab and customize the group as desired.&amp;#160; &lt;/p&gt;  &lt;p&gt;On the Ribbon designer, select the tab, open the &lt;strong&gt;Properties&lt;/strong&gt; window, and then set the &lt;strong&gt;OfficeId&lt;/strong&gt; of the tab to &lt;strong&gt;TabReadMessage&lt;/strong&gt;.&amp;#160; &lt;strong&gt;TabReadMessage&lt;/strong&gt; is the control ID of the default tab that appears on the Ribbon of a mail message that is open in read mode.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/DisplayingaCustomGroupinBoththeOutlookMa_D2A0/image_7.png" mce_href="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/DisplayingaCustomGroupinBoththeOutlookMa_D2A0/image_7.png"&gt;&lt;img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/DisplayingaCustomGroupinBoththeOutlookMa_D2A0/image_thumb_2.png" width="405" height="336" mce_src="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/DisplayingaCustomGroupinBoththeOutlookMa_D2A0/image_thumb_2.png" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Ok. Now when you run the project, your custom group will appear only if you open a mail item in read mode. Now you need to add second Ribbon to your project to display this custom group in a mail item that is open in compose mode.&lt;/p&gt;  &lt;p&gt;Add a second &lt;strong&gt;Ribbon (Visual Designer)&lt;/strong&gt; to the project. Then, set the &lt;strong&gt;RibbonType&lt;/strong&gt; property of the Ribbon to &lt;strong&gt;Microsoft.Outlook.Mail.Compose&lt;/strong&gt; as follows:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/DisplayingaCustomGroupinBoththeOutlookMa_D2A0/image_12.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/DisplayingaCustomGroupinBoththeOutlookMa_D2A0/image_thumb_4.png" width="295" height="399" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;On the Ribbon designer, select the tab of the second Ribbon, open the &lt;strong&gt;Properties&lt;/strong&gt; window, and then set the &lt;strong&gt;OfficeId&lt;/strong&gt; of the tab to &lt;strong&gt;TabNewMailMessage&lt;/strong&gt;.&amp;#160; &lt;strong&gt;TabNewMailMessage&lt;/strong&gt; is the control ID of the default tab that appears on the Ribbon of a mail message that is open in compose mode.&amp;#160; &lt;/p&gt;  &lt;p&gt;I know what your thinking. Do you mean I have to create two separate custom groups? That defeats the whole point of trying to do this right?&amp;#160; Yes that would. Fortunately, you don’t have to create two custom groups. You only have to create two Ribbons as I have shown here. You can use the same custom group in both Ribbons.&amp;#160; Here is how:&lt;/p&gt;  &lt;p&gt;Open the first Ribbon that you created in the Ribbon Designer.&amp;#160; In the Ribbon Designer, select your custom group. In the &lt;strong&gt;Properties&lt;/strong&gt; window, set the &lt;strong&gt;Modifiers&lt;/strong&gt; property of the group to &lt;strong&gt;Public&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;Open the code file of the second Ribbon that you created (called Ribbon2 in my project).&lt;/p&gt;  &lt;p&gt;In the constructor of the second Ribbon, add the custom group from Ribbon1 to Ribbon2 as follows: &lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;public &lt;/span&gt;Ribbon2()
{
    InitializeComponent();
    &lt;span style="color: #2b91af"&gt;Ribbon1 &lt;/span&gt;firstRibbon = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Ribbon1&lt;/span&gt;();
    &lt;span style="color: blue"&gt;this&lt;/span&gt;.tab1.Groups.Add(firstRibbon.group1);
}&lt;/pre&gt;

&lt;p&gt;You can read more about adding custom groups to built-in tabs in the following MSDN articles:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/bb608593.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/bb608593.aspx"&gt;How to: Customize a Built-in tab&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/bb608616.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/bb608616.aspx"&gt;How to: Get Started Customizing the Ribbon&lt;/a&gt;&lt;/p&gt;
&lt;a href="http://msdn2.microsoft.com/en-us/library/bb386089.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/bb386089.aspx"&gt;Ribbon Designer&lt;/a&gt; 

&lt;p&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/bb398246.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/bb398246.aspx"&gt;Customizing a Ribbon for Outlook&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9937317" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/vsto/archive/tags/Outlook+2007/default.aspx">Outlook 2007</category><category domain="http://blogs.msdn.com/vsto/archive/tags/VSTO/default.aspx">VSTO</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Norm+Estabrook/default.aspx">Norm Estabrook</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Ribbon/default.aspx">Ribbon</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Office+2007/default.aspx">Office 2007</category><category domain="http://blogs.msdn.com/vsto/archive/tags/VS2008/default.aspx">VS2008</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Office+Development/default.aspx">Office Development</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Office+2010/default.aspx">Office 2010</category></item><item><title>Using Office 2010 Extensibility Schemas with VSTO addins for Beta 2 (Stephen Peters)</title><link>http://blogs.msdn.com/vsto/archive/2009/12/04/using-office-2010-extensibility-schemas-with-vsto-addins-for-beta-2-stephen-peters.aspx</link><pubDate>Fri, 04 Dec 2009 22:06:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9932795</guid><dc:creator>VSTO Team</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/vsto/comments/9932795.aspx</comments><wfw:commentRss>http://blogs.msdn.com/vsto/commentrss.aspx?PostID=9932795</wfw:commentRss><description>&lt;P&gt;Office 2010 brings in many new features to the Ribbon and Backstage extensibility. In order to take advantage of those changes in VSTO addins, you will need to update your ribbon XML projects to use the new Office 2010 schema. &lt;/P&gt;
&lt;P&gt;First, you will need to see if the schema is installed. To do this, look in “C:\Program Files\Microsoft Visual Studio 10.0\Xml\Schemas\1033” (you might need to modify this to point to your Visual Studio installation directory). If customui14.xsd is there, you can skip ahead to the next paragraph. Otherwise download the schema from &lt;A href="http://download.microsoft.com/download/F/F/3/FF36D32F-4080-494B-83B8-49DADC68A999/Office2010FluentUISchema.exe" mce_href="http://download.microsoft.com/download/F/F/3/FF36D32F-4080-494B-83B8-49DADC68A999/Office2010FluentUISchema.exe"&gt;here&lt;/A&gt;, and install it in the directory above. When you are done, double check to make sure that the custom14ui.xsd file is there.&lt;/P&gt;
&lt;P&gt;Go to the Ribbon XML item that you want to use on Office 2010. For this blog post I am going to use a Word 2010 addin with a single Ribbon XML item, but the same code can work with any VSTO project with only minor modifications.&lt;/P&gt;
&lt;P&gt;At the top Ribbon1.xml, there is a line&lt;/P&gt;&lt;PRE class=code&gt;&lt;SPAN style="COLOR: blue"&gt;  &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;customUI &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;xmlns&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="http://schemas.microsoft.com/office/2006/01/customui" &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;onLoad&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="Ribbon_Load"&amp;gt;&lt;/PRE&gt;&lt;A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"&gt;&lt;/A&gt;&lt;/SPAN&gt;
&lt;P&gt;You will want to replace the URL with&lt;/P&gt;&lt;PRE class=code&gt;&lt;SPAN style="COLOR: blue"&gt;  http://schemas.microsoft.com/office/2009/07/customui&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;If you look in the properties window for the XML document, the schema for the document should now point to the customui14.xsd that was installed. Now we can play around with it a bit. Under &amp;lt;/ribbon&amp;gt; in Ribbon1.xml, add the following code:&lt;PRE class=code&gt;&lt;SPAN style="COLOR: blue"&gt;  &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;backstage&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;
    &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;tab &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;id&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="VSTOTab" &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;label&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="VSTO Tab" &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;insertAfterMso&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="TabInfo"&amp;gt;
      &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;firstColumn&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;
        &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;group &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;id&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="VSTOGroup" &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;label&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="Hello From VSTO!"&amp;gt;
          &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;topItems&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;
            &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;button &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;id&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="AddMoreCowbell"
              &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;label&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="Add More Cowbell"
              &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;onAction&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="AddMoreCowbell" /&amp;gt;
          &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;topItems&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;
        &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;group&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;
      &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;firstColumn&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;
    &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;tab&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;
  &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;backstage&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;
&lt;/PRE&gt;&lt;A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"&gt;&lt;/A&gt;&lt;/SPAN&gt;
&lt;P&gt;We will also need to add the callback to Ribbon1.cs:&lt;/P&gt;&lt;PRE class=code&gt;&lt;SPAN style="COLOR: blue"&gt;public void &lt;/SPAN&gt;AddMoreCowbell(Office.&lt;SPAN style="COLOR: #2b91af"&gt;IRibbonControl &lt;/SPAN&gt;control)
{
    System.Windows.Forms.&lt;SPAN style="COLOR: #2b91af"&gt;MessageBox&lt;/SPAN&gt;.Show(&lt;SPAN style="COLOR: #a31515"&gt;"Fever Cured"&lt;/SPAN&gt;);
}&lt;/PRE&gt;
&lt;P&gt;And, of course, the integration in ThisAddin.cs&lt;/P&gt;&lt;PRE class=code&gt;&lt;SPAN style="COLOR: blue"&gt;protected override &lt;/SPAN&gt;Microsoft.Office.Core.&lt;SPAN style="COLOR: #2b91af"&gt;IRibbonExtensibility &lt;/SPAN&gt;CreateRibbonExtensibilityObject()
{
    &lt;SPAN style="COLOR: blue"&gt;return new &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Ribbon1&lt;/SPAN&gt;();
}&lt;/PRE&gt;
&lt;P&gt;Run your add-in, and when you go to the backstage, you will find the backstage tab that we just added:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/UsingOffice2010ExtensibilitySchemaswithV_C281/clip_image002_2.jpg" mce_href="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/UsingOffice2010ExtensibilitySchemaswithV_C281/clip_image002_2.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=clip_image002 border=0 alt=clip_image002 src="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/UsingOffice2010ExtensibilitySchemaswithV_C281/clip_image002_thumb.jpg" width=244 height=193 mce_src="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/UsingOffice2010ExtensibilitySchemaswithV_C281/clip_image002_thumb.jpg"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Now that you have the schemas set up, you can read up more on extending Backstage and new Ribbon features here:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/ee692176(office.14).aspx" mce_href="http://msdn.microsoft.com/en-us/library/ee692176(office.14).aspx"&gt;Microsoft Office 2010 Technical Articles&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; - &lt;A href="http://msdn.microsoft.com/en-us/library/ee815851(office.14).aspx" mce_href="http://msdn.microsoft.com/en-us/library/ee815851(office.14).aspx"&gt;Customizing the Office 2010 Backstage View for Developers&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; - &lt;A href="http://msdn.microsoft.com/en-us/library/ee691834(office.14).aspx" mce_href="http://msdn.microsoft.com/en-us/library/ee691834(office.14).aspx"&gt;Ribbon Extensibility in Office 2010: Tab Activation and Auto-Scaling&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://download.microsoft.com/download/F/F/3/FF36D32F-4080-494B-83B8-49DADC68A999/Office2010FluentUISchema.exe" mce_href="http://download.microsoft.com/download/F/F/3/FF36D32F-4080-494B-83B8-49DADC68A999/Office2010FluentUISchema.exe"&gt;Office 2010 Custom UI Schema&lt;/A&gt; (repost from above)&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9932795" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/vsto/archive/tags/Ribbon/default.aspx">Ribbon</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Office+Development/default.aspx">Office Development</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Office+2010/default.aspx">Office 2010</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Stephen+Peters/default.aspx">Stephen Peters</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Backstage/default.aspx">Backstage</category></item><item><title>Will your VSTO addin run on Office 2010 64-bit? Yes, probably. (Christin Boyd)</title><link>http://blogs.msdn.com/vsto/archive/2009/08/05/will-your-vsto-addin-run-on-office-2010-64-bit-yes-probably-christin-boyd.aspx</link><pubDate>Thu, 06 Aug 2009 01:05:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9858450</guid><dc:creator>VSTO Team</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/vsto/comments/9858450.aspx</comments><wfw:commentRss>http://blogs.msdn.com/vsto/commentrss.aspx?PostID=9858450</wfw:commentRss><description>&lt;p&gt;The Visual Studio team is designing the runtime components for Office 2010 so that your Visual Studio Tools for Office 2005 and Visual Studio 2008 .NET addins, document solutions and spreadsheet solutions will run on 64-bit Office 2010.&amp;#160; These runtime components will ship with Office 2010, so your end-users won’t even have to download a new runtime!&amp;#160; How easy is that?&amp;#160; There are a few rare exceptions that I’ll discuss in this blog entry.&amp;#160; &lt;/p&gt;  &lt;p&gt;The miracle of managed code allows you to write C# or Visual Basic .NET code that compiles to “Any CPU” using the Compile setting in your Visual Studio project.&amp;#160; Your code compiles to MSIL with Visual Studio, and then at runtime it gets JIT compiled to the correct chip set, either AMD, Intel, 32-bit or 64-bit.&amp;#160; The first exception to this wondrous technology is the oldest versions of .NET Framework 1.0 and 1.1 will not enable this 64-bit transformation.&lt;/p&gt;  &lt;p&gt;The other thing to lookout for is calls to process invoke (p/invoke) in your code. If you try to call native API methods using p/invoke you could have issues with your VSTO solution running properly on 64-bit Office 2010.&amp;#160; &lt;/p&gt;  &lt;p&gt;You will have problems if your code makes deliberate calls to p/invoke a Win32 API that does not have exactly the same signature (method name, parameter list, and DLL name) of an equivalent Win64 API.&amp;#160; This is true for any solution you write regardless of targeting Office as the platform.&amp;#160; You can find a ton of information in MSDN and blogs by such luminaries as Scott Hanselman about writing Windows API calls so that they will run on either 32-bit or 64-bit Windows.&amp;#160; Here is a generalized code snippet for handling cases where the method name or the DLL name is different:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div id="codeSnippetWrapper" style="border-right: silver 1px solid; padding-right: 4px; border-top: silver 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: silver 1px solid; width: 97.5%; cursor: text; direction: ltr; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: silver 1px solid; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; height: 244px; background-color: #f4f4f4; text-align: left"&gt;   &lt;pre id="codeSnippet" style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;p align="left"&gt;&lt;span style="color: #008000"&gt;//YourFunction has the same name, parameters, and DLL name in 32bit and 64bit&lt;/span&gt;&lt;br /&gt;YourFunction();&lt;br /&gt;&lt;br /&gt;Import(&lt;span style="color: #006080"&gt;&amp;quot;LIBRARY&amp;quot;&lt;/span&gt;, EntryPoint = &lt;span style="color: #006080"&gt;&amp;quot;YOURFUNCTION&amp;quot;&lt;/span&gt;, CharSet = CharSet.Unicode)]&lt;br /&gt;private &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;extern&lt;/span&gt; &lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; YouFunction();&lt;/p&gt;&lt;p align="left"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #008000"&gt;//In some cases, the method name is different in Win32 API and Win64 API, &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #008000"&gt;//so use the following code block in stead of the above 3 lines of code.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (Marshal.SizeOf(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(IntPtr)) == 4)&lt;br /&gt;{&lt;br /&gt;    YourFunction32();&lt;br /&gt;}&lt;br /&gt;&lt;span style="color: #0000ff"&gt;else&lt;/span&gt; &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (Marshal.SizeOf(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(IntPtr)) == 8)&lt;br /&gt;{&lt;br /&gt;    YourFunction64();&lt;br /&gt;}&lt;/p&gt;&lt;p align="left"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Import(&lt;span style="color: #006080"&gt;&amp;quot;LIBRARY32&amp;quot;&lt;/span&gt;, EntryPoint = &lt;span style="color: #006080"&gt;&amp;quot;YOURFUNCTION32&amp;quot;&lt;/span&gt;, CharSet = CharSet.Unicode)]&lt;br /&gt;private &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;extern&lt;/span&gt; &lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; YourFunction32();&lt;br /&gt;&lt;br /&gt;Import(&lt;span style="color: #006080"&gt;&amp;quot;LIBRARY64&amp;quot;&lt;/span&gt;, EntryPoint = &lt;span style="color: #006080"&gt;&amp;quot; YOURFUNCTION64&amp;quot;&lt;/span&gt;, CharSet = CharSet.Unicode)]&lt;br /&gt;private &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;extern&lt;/span&gt; &lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; YourFunction64();&lt;br /&gt;&lt;/p&gt;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;h3&gt;Resources:&lt;/h3&gt;

&lt;p&gt;Here are more resources to help you author your solutions today so that they will run without needing a recompile when your users install 64-bit Office 2010.&lt;/p&gt;

&lt;p&gt;MSDN Library Visual Studio 2005 article on developing &lt;a href="http://msdn.microsoft.com/en-us/library/ms241064(VS.80).aspx" target="_blank"&gt;64-bit Applications&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;MSDN Library Visual Studio 2008 article on developing &lt;a href="http://msdn.microsoft.com/en-us/library/ms241064.aspx" target="_blank"&gt;64-bit Applications&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.msdn.com/cumgranosalis/archive/2005/12/09/Win64RegistryPart1.aspx" target="_blank"&gt;How to access the “real” x64 registry from a Win32 .NET Application – Part I&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms953313.aspx" target="_blank"&gt;The Myth of .NET Purity, Reloaded&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For migrating your really old apps with lots of native calls to .NET, try checking if your native calls have an equivalent .NET call:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa302340.aspx" target="_blank"&gt;Microsoft Win32 to Microsoft .NET Framework API Map&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/sd10k43k.aspx" target="_blank"&gt;Interoperating with Unmanaged Code&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Finally I should mention that this is my last post (for a while at least) on this blog because I am leaving Microsoft.&amp;#160; I’m going to work on a charity project teaching robotics programming to high school kids in my “inner city” neighborhood for at least the next 6 months.&amp;#160; The project is called &lt;a href="http://www.teamxbot.org/" target="_blank"&gt;Team Xbot&lt;/a&gt;!&amp;#160; Keep an eye on these kids as they go on to good colleges and great jobs in the next few years!&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Sincerely, Christin Boyd, Program Manager&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9858450" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/vsto/archive/tags/runtime/default.aspx">runtime</category><category domain="http://blogs.msdn.com/vsto/archive/tags/VSTO/default.aspx">VSTO</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Christin+Boyd/default.aspx">Christin Boyd</category><category domain="http://blogs.msdn.com/vsto/archive/tags/primary+interop+assemblies/default.aspx">primary interop assemblies</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Office+Development/default.aspx">Office Development</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Office+14/default.aspx">Office 14</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Office+2010/default.aspx">Office 2010</category></item><item><title>BUG: “Old format or invalid type library” error when automating Excel (Christin Boyd)</title><link>http://blogs.msdn.com/vsto/archive/2009/07/06/bug-old-format-or-invalid-type-library-error-when-automating-excel-christin-boyd.aspx</link><pubDate>Tue, 07 Jul 2009 01:54:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9820860</guid><dc:creator>VSTO Team</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/vsto/comments/9820860.aspx</comments><wfw:commentRss>http://blogs.msdn.com/vsto/commentrss.aspx?PostID=9820860</wfw:commentRss><description>&lt;p&gt;A customer recently reported this bug when running their Shared Addin for Excel on French Windows.&amp;#160; &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Error: 0x80028018 (-2147647512)      &lt;br /&gt;Description: Old Format or Invalid Type Library&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;His solution worked great on English Windows, but gave errors in any other language.&amp;#160; This is a known problem in Excel and there are a few workarounds that work depending on the way you’re writing your Excel Addin.&amp;#160;&amp;#160; Let me take you through the problem, variations on the problem, and different solutions depending on which Visual Studio project template you choose to start your Addin.&lt;/p&gt;  &lt;p&gt;The bug was originally documented in a &lt;a href="http://support.microsoft.com/kb/320369" target="_blank"&gt;KB 320369 article&lt;/a&gt;, which gives detailed repro steps, explanation, and two workarounds with sample code.&amp;#160; So why am I writing a blog post if the KB article covers everything?&amp;#160;&amp;#160; Three reasons.&amp;#160; &lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Because we’re fixing the problem in CLR 4 and I want to encourage you to use one of the recommended workarounds in your current solutions so that you’re ready when your users upgrade to .NET Framework 4.&amp;#160; &lt;/li&gt;    &lt;li&gt;Also, there are parts of the KB article that are a bit confusing, so I’ll try to add some color commentary to help explain what’s causing the problem.&amp;#160; &lt;/li&gt;    &lt;li&gt;And third, these problems do not occur if you use VSTO 2005 SE, VSTO 3.0 (which ships with Visual Studio 2008), or Visual Studio 2010.&amp;#160; I’ll explain why and how later. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;The KB article describes the problem:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Error: 0x80028018 (-2147647512)      &lt;br /&gt;Description: Old Format or Invalid Type Library&lt;/p&gt;    &lt;p&gt;You receive this error calling an Excel method when the following conditions are true: &lt;/p&gt;    &lt;ul&gt;     &lt;li&gt;The method requires an LCID (locale identifier). &lt;/li&gt;      &lt;li&gt;You run an English version of Excel. However, the regional settings for the computer are configured for a non-English language. &lt;/li&gt;   &lt;/ul&gt;    &lt;p&gt;If the client computer runs the English version of Excel and the locale for the current user is configured for a language other than English, Excel will try to locate the language pack for the configured language. If the language pack is not found, the error is reported.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The quote from the KB article is accurate, but can be confusing.&amp;#160; It is very difficult to determine if the Excel method you want to call requires LCID or not.&amp;#160; The Primary Interop Assembly (PIA) does not indicate whether or not the LCID is needed, however VBA does not hide the need for LCID.&amp;#160; Part of the reason why Excel hasn’t changed its methods is to maintain back compatibility with all the VBA code in the universe.&amp;#160; &lt;/p&gt;  &lt;h3&gt;Fixed in VSTO&lt;/h3&gt;  &lt;p&gt;VSTO implemented a fix in VSTO 2005 Second Edition (SE).&amp;#160; You can read more about this fix in &lt;a href="http://blogs.msdn.com/eric_carter/archive/2005/06/15/429515.aspx" target="_blank"&gt;Eric Carter’s blog post&lt;/a&gt;.&amp;#160; The fix is also in all subsequent versions of Visual Studio 2008 and will be in Visual Studio 2010.&amp;#160; You know you are using “VSTO” when you create a new Project in Visual Studio and select an Excel &amp;lt;version number&amp;gt; Workbook, Excel &amp;lt;version number&amp;gt; Template or Excel &amp;lt;version number&amp;gt; Addin.&amp;#160; The fix was not implemented in the Shared Addin template in any version of Visual Studio.&amp;#160; If you create a WinForms, WPF, Web or console application that calls Excel, then you will see this bug on non-English Windows.&lt;/p&gt;  &lt;h3&gt;Workarounds &lt;/h3&gt;  &lt;p&gt;If you are using the Shared Addin template, a WinForm, WPF, Web or Console application with any version of Visual Studio, then you should use the &lt;a href="http://support.microsoft.com/kb/320369" target="_blank"&gt;KB 320369 article&lt;/a&gt; to solve the problem.&lt;/p&gt;  &lt;p&gt;The workaround is to write explicit calls to set the thread’s culture before calling into Excel.&amp;#160; You can then reset the culture back to what it was before after you are finished calling Excel.&amp;#160; &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Install the Multilingual User Interface Pack for your version of Office. &lt;/li&gt;    &lt;li&gt;Execute the Excel method or property by using &lt;b&gt;InvokeMember&lt;/b&gt; so that you can specify the &lt;b&gt;CultureInfo&lt;/b&gt; for the call. For example, the following code illustrates how you can invoke the &lt;b&gt;Workbooks&lt;/b&gt; object &lt;b&gt;Add&lt;/b&gt; method with &amp;quot;en-US&amp;quot; as the &lt;b&gt;CultureInfo&lt;/b&gt;:       &lt;div id="codeSnippetWrapper" style="border-right: silver 1px solid; padding-right: 4px; border-top: silver 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: silver 1px solid; width: 97.5%; cursor: text; direction: ltr; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: silver 1px solid; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4; text-align: left"&gt;       &lt;pre id="codeSnippet" style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;Dim&lt;/span&gt; oApp &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; &lt;span style="color: #0000ff"&gt;New&lt;/span&gt; Excel.Application()&lt;br /&gt;oApp.Visible = &lt;span style="color: #0000ff"&gt;True&lt;/span&gt;&lt;br /&gt;oApp.UserControl = &lt;span style="color: #0000ff"&gt;True&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;Dim&lt;/span&gt; oBooks &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Object&lt;/span&gt; = oApp.Workbooks&lt;br /&gt;&lt;span style="color: #0000ff"&gt;Dim&lt;/span&gt; ci &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; System.Globalization.CultureInfo = &lt;span style="color: #0000ff"&gt;New&lt;/span&gt; System.Globalization.CultureInfo(&lt;span style="color: #006080"&gt;&amp;quot;en-US&amp;quot;&lt;/span&gt;)&lt;br /&gt;oBooks.&lt;span style="color: #0000ff"&gt;GetType&lt;/span&gt;().InvokeMember(&lt;span style="color: #006080"&gt;&amp;quot;Add&amp;quot;&lt;/span&gt;, Reflection.BindingFlags.InvokeMethod, &lt;span style="color: #0000ff"&gt;Nothing&lt;/span&gt;, oBooks, &lt;span style="color: #0000ff"&gt;Nothing&lt;/span&gt;, ci)&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;

      &lt;br /&gt;&lt;/div&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Or, instead of the above bullet and code sample, set the &lt;b&gt;CultureInfo&lt;/b&gt; prior to calling the Excel method, and then you can reset it after your Excel call: &lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
  &lt;div id="codeSnippetWrapper" style="border-right: silver 1px solid; padding-right: 4px; border-top: silver 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: silver 1px solid; width: 97.5%; cursor: text; direction: ltr; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: silver 1px solid; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4; text-align: left"&gt;
    &lt;pre id="codeSnippet" style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;Dim&lt;/span&gt; oApp &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; &lt;span style="color: #0000ff"&gt;New&lt;/span&gt; Excel.Application()&lt;br /&gt;oApp.Visible = &lt;span style="color: #0000ff"&gt;True&lt;/span&gt;&lt;br /&gt;oApp.UserControl = &lt;span style="color: #0000ff"&gt;True&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;Dim&lt;/span&gt; oldCI &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; System.Globalization.CultureInfo = _&lt;br /&gt;    System.Threading.Thread.CurrentThread.CurrentCulture&lt;br /&gt;System.Threading.Thread.CurrentThread.CurrentCulture = _&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;New&lt;/span&gt; System.Globalization.CultureInfo(&lt;span style="color: #006080"&gt;&amp;quot;en-US&amp;quot;&lt;/span&gt;)&lt;br /&gt;oApp.Workbooks.Add()&lt;br /&gt;System.Threading.Thread.CurrentThread.CurrentCulture = oldCI&lt;/pre&gt;

    &lt;br /&gt;&lt;/div&gt;
&lt;/blockquote&gt;

&lt;p&gt;The .NET Framework 4 will solve this whole culture problem.&amp;#160; Excel is not going to change its culture sensitivity because of the need to support backwards compatibility.&amp;#160;&amp;#160; Starting with CLR 4.0, when managed code calls into a COM component and an LCID is required, then the CLR will pass LCID = 1033.&amp;#160; Note that this is how VBA passes LCIDs.&amp;#160;&amp;#160; This means that Visual Studio 2010 project templates for Excel Addins can stop wrapping all Excel projects with LCID proxy.&amp;#160;&amp;#160; In the future, when you use VS 2010 and .NET 4 to write your Excel automation programs from a Shared Addin, console, Winforms, WPF, or Web application, you won’t need to wrap your calls either.&amp;#160; &lt;/p&gt;

&lt;p&gt;-Christin Boyd, Program Manager &amp;amp; &lt;a href="http://blogs.msdn.com/mshneer/" target="_blank"&gt;Misha Shneerson&lt;/a&gt;, Senior Developer&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9820860" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/vsto/archive/tags/VSTO/default.aspx">VSTO</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Christin+Boyd/default.aspx">Christin Boyd</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Excel+2003/default.aspx">Excel 2003</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Excel+2007/default.aspx">Excel 2007</category><category domain="http://blogs.msdn.com/vsto/archive/tags/primary+interop+assemblies/default.aspx">primary interop assemblies</category><category domain="http://blogs.msdn.com/vsto/archive/tags/VB/default.aspx">VB</category><category domain="http://blogs.msdn.com/vsto/archive/tags/VBA/default.aspx">VBA</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Office+Development/default.aspx">Office Development</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Visual+Studio+2010/default.aspx">Visual Studio 2010</category></item><item><title>Community Article: Automate Common Office Tasks (Beth Massi)</title><link>http://blogs.msdn.com/vsto/archive/2009/06/25/community-article-automate-common-office-tasks-beth-massi.aspx</link><pubDate>Fri, 26 Jun 2009 02:34:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9804476</guid><dc:creator>VSTO Team</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/vsto/comments/9804476.aspx</comments><wfw:commentRss>http://blogs.msdn.com/vsto/commentrss.aspx?PostID=9804476</wfw:commentRss><description>&lt;p&gt;If you haven’t seen it yet, we’ve got &lt;a href="http://msdn.microsoft.com/en-us/vsto/dd935909.aspx" target="_blank"&gt;a new article&lt;/a&gt; from &lt;a href="https://mvp.support.microsoft.com/profile=169AE602-45EF-47E6-8868-CA3E91D0A1EE"&gt;Robert Green&lt;/a&gt; (MVP) up on the &lt;a href="http://msdn.microsoft.com/en-us/vsto/default.aspx" target="_blank"&gt;VSTO Dev Center&lt;/a&gt;. In this article, learn how you can use Visual Studio to build application-level add-ins that automate common Microsoft Office tasks. It’s a good introduction to Office development with Visual Studio so check it out!&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/vsto/dd935909.aspx" target="_blank"&gt;&lt;strong&gt;Create an Application-Level Add-In to Automate Common Office Tasks&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Enjoy,   &lt;br /&gt;-&lt;a href="http://blogs.msdn.com/bethmassi" target="_blank"&gt;Beth Massi&lt;/a&gt;, Visual Studio Community&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9804476" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/vsto/archive/tags/VSTO/default.aspx">VSTO</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Beth+Massi/default.aspx">Beth Massi</category><category domain="http://blogs.msdn.com/vsto/archive/tags/add-ins/default.aspx">add-ins</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Community/default.aspx">Community</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Office+Development/default.aspx">Office Development</category></item><item><title>Do Your Outlook UI Elements Need Counseling? - Get your Form Regions, Ribbons, and Task Panes Talking to Each Other Again (Norm Estabrook)</title><link>http://blogs.msdn.com/vsto/archive/2009/06/03/do-your-outlook-ui-elements-need-counseling-get-your-form-regions-ribbons-and-task-panes-talking-to-each-other-again-norm-estabrook.aspx</link><pubDate>Thu, 04 Jun 2009 01:30:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9693769</guid><dc:creator>VSTO Team</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/vsto/comments/9693769.aspx</comments><wfw:commentRss>http://blogs.msdn.com/vsto/commentrss.aspx?PostID=9693769</wfw:commentRss><description>&lt;p&gt;So you want to open a task pane by using a button on the Ribbon. You also want a form region that appears in an e-mail item to detect the state of a control on a custom task pane so that you can add or remove an option that appears in a Ribbon menu right? Ok, I completely made this scenario up. But at some point, somewhere along the way, you might say to yourself – how do I get to that gallery on my Ribbon from my task pane? or how do I enable the user to populate that combo box on the form region by selecting a control on the Ribbon? Well if that describes something that you are trying to do, then this post is for you. Let’s start with Ribbons. The other two (form regions and task panes) are bit more troublesome.&lt;/p&gt;  &lt;h4&gt;Ribbons&lt;/h4&gt;  &lt;p&gt;Ribbon controls are the easiest to access from other areas of your application. Assuming that your custom Ribbon is named &lt;em&gt;Ribbon1&lt;/em&gt;, here is what you do:&lt;/p&gt;  &lt;p align="left"&gt;&lt;span style="color: #2b91af"&gt;ThisRibbonCollection &lt;/span&gt;ribbonCollection =    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #2b91af"&gt;Globals&lt;/span&gt;.Ribbons    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; [&lt;span style="color: #2b91af"&gt;Globals&lt;/span&gt;.ThisAddIn.Application.ActiveInspector()];    &lt;br /&gt;ribbonCollection.Ribbon1.comboBox1.Text = &lt;span style="color: #a31515"&gt;&amp;quot;Hello World&amp;quot;&lt;/span&gt;;&lt;/p&gt;  &lt;p&gt;You can read more about this &lt;a href="http://msdn.microsoft.com/en-us/library/bb772088.aspx"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;h4&gt;Form Regions&lt;/h4&gt;  &lt;p&gt;For the VB folks, this is a snap. C# developers have to do a bit more work. That is because by default, in a C# project, the controls that you add to a form region are private. For each control that you want to access, you have to set the &lt;strong&gt;Modifiers&lt;/strong&gt; property of the control to &lt;strong&gt;Internal &lt;/strong&gt;or &lt;strong&gt;Public&lt;/strong&gt;. For example: &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/OutlookUICounselingGetyourFormRegionsRib_E1EA/image_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/OutlookUICounselingGetyourFormRegionsRib_E1EA/image_thumb.png" width="321" height="360" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;You can then add code to access the control. For example, assuming that your form region is named &lt;em&gt;FormRegion1&lt;/em&gt;, you could use the following code:&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color: #2b91af"&gt;WindowFormRegionCollection &lt;/span&gt;formRegions =
    &lt;span style="color: #2b91af"&gt;Globals&lt;/span&gt;.FormRegions
        [&lt;span style="color: #2b91af"&gt;Globals&lt;/span&gt;.ThisAddIn.Application.ActiveInspector()];
formRegions.FormRegion1.textBox1.Text = &lt;span style="color: #a31515"&gt;&amp;quot;Hello World&amp;quot;&lt;/span&gt;;&lt;/pre&gt;

&lt;p&gt;You can read more about this &lt;a href="http://msdn.microsoft.com/en-us/library/bb772084.aspx"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h4&gt;Custom Task Panes&lt;/h4&gt;

&lt;p&gt;Controls on task panes require the same tweaks described for form regions above.&amp;#160; Here is an example of how to get to a button on a task pane. This example makes the following assumptions:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;The user control of the custom task pane is named &lt;em&gt;MyUserControl&lt;/em&gt;. &lt;/li&gt;

  &lt;li&gt;The task pane is named &lt;em&gt;myCustomTaskPane&lt;/em&gt; and it is declared as public in your code.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;((&lt;span style="color: #2b91af"&gt;MyUserControl&lt;/span&gt;)&lt;span style="color: #2b91af"&gt;Globals&lt;/span&gt;.ThisAddIn.myCustomTaskPane.Control).button1.Text = &lt;span style="color: #a31515"&gt;&amp;quot;It Worked&amp;quot;&lt;/span&gt;;&lt;/p&gt;

&lt;p&gt;If have not yet created a custom task pane, see &lt;a href="http://msdn.microsoft.com/en-us/library/aa942846.aspx"&gt;this topic&lt;/a&gt; and it will all make sense.&lt;/p&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;As a side note, if you are adding custom task panes to Outlook Inspector windows, you have to write a bit of code to map each Inspector window with it’s own instance of a custom task pane. If you don’t do this mapping, you get all kinds of wacky issues.&amp;#160; For an example of how to do this, see the following &lt;a href="http://msdn.microsoft.com/en-us/library/bb296010.aspx"&gt;article&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For the sake of being thorough, here is an example of how you can access a task pane created by using the guidance in that &lt;a href="http://msdn.microsoft.com/en-us/library/bb296010.aspx"&gt;article&lt;/a&gt;.&amp;#160; &lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;private void &lt;/span&gt;toggleButton1_Click(&lt;span style="color: blue"&gt;object &lt;/span&gt;sender, &lt;span style="color: #2b91af"&gt;RibbonControlEventArgs &lt;/span&gt;e)
{
    Outlook.&lt;span style="color: #2b91af"&gt;Inspector &lt;/span&gt;inspector = (Outlook.&lt;span style="color: #2b91af"&gt;Inspector&lt;/span&gt;)e.Control.Context;
    &lt;span style="color: #2b91af"&gt;InspectorWrapper &lt;/span&gt;inspectorWrapper = &lt;span style="color: #2b91af"&gt;Globals&lt;/span&gt;.ThisAddIn.InspectorWrappers[inspector];
    &lt;span style="color: #2b91af"&gt;CustomTaskPane &lt;/span&gt;taskPane = inspectorWrapper.CustomTaskPane;
    &lt;span style="color: blue"&gt;if &lt;/span&gt;(taskPane != &lt;span style="color: blue"&gt;null&lt;/span&gt;)
    {
        taskPane.Visible = ((&lt;span style="color: #2b91af"&gt;RibbonToggleButton&lt;/span&gt;)sender).Checked;
        taskPane.DockPosition = Microsoft.Office.Core.&lt;span style="color: #2b91af"&gt;MsoCTPDockPosition&lt;/span&gt;.msoCTPDockPositionBottom;
        taskPane.Height = 475;
    }
}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;Hope this helps!&lt;/p&gt;

&lt;p&gt;Norm E.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9693769" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/vsto/archive/tags/Outlook+2007/default.aspx">Outlook 2007</category><category domain="http://blogs.msdn.com/vsto/archive/tags/VSTO/default.aspx">VSTO</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Norm+Estabrook/default.aspx">Norm Estabrook</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Ribbon/default.aspx">Ribbon</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Office+2007/default.aspx">Office 2007</category><category domain="http://blogs.msdn.com/vsto/archive/tags/VS2008/default.aspx">VS2008</category><category domain="http://blogs.msdn.com/vsto/archive/tags/add-ins/default.aspx">add-ins</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Office+Development/default.aspx">Office Development</category></item><item><title>Sign up for Office 2010 Technical Preview</title><link>http://blogs.msdn.com/vsto/archive/2009/05/12/sign-up-for-office-2010-technical-preview.aspx</link><pubDate>Tue, 12 May 2009 20:36:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9607782</guid><dc:creator>VSTO Team</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/vsto/comments/9607782.aspx</comments><wfw:commentRss>http://blogs.msdn.com/vsto/commentrss.aspx?PostID=9607782</wfw:commentRss><description>&lt;p&gt;I’m at TechEd in LA, but it seems I could get just as much excitement just watching the Twittersphere today and watching #tela09 tags!&amp;#160; And my feet are killing me.&amp;#160; So be glad you’re sitting at your computer instead of walking around Los Angeles!&amp;#160; Let me give you some highlights for Office developers:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.msteched.com/online/home.aspx" target="_blank"&gt;Watch the Keynotes&lt;/a&gt; which include Office 2010 demos.&amp;#160; Also some &lt;a href="http://www.msteched.com/online/channels.aspx?cname=track&amp;amp;channel=Office+%26+SharePoint" target="_blank"&gt;interviews on Office and SharePoint&lt;/a&gt; on the same TechEd site.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.office2010themovie.com/" target="_blank"&gt;Office 2010 The Movie:&amp;#160; Countdown to Awesome&lt;/a&gt; is the new site where you can watch a slick video and more importantly, click the Sign up for the Microsoft Office 2010 Technology Preview.&amp;#160; When you click the link they show you the “fine print” which I will now print in large font:&lt;/p&gt;  &lt;h4&gt;By registering you are signing up to be considered for the Technical Preview Program, you will be &lt;strong&gt;waitlisted for consideration to be invited&lt;/strong&gt; into the Technical Preview Program. We will notify invitees in early to mid July.&lt;/h4&gt;  &lt;p&gt;“What does that mean?” you ask.&amp;#160; Well, it means that Microsoft wants to collect a wide variety of customer-types and ensure that our TechPreview covers all the different types of customers.&amp;#160; For example, the sign-up form asks if you will test the Tech Preview at Home or Work.&amp;#160; Be honest in your answer because we truly want to get perspectives from all types of Office users.&amp;#160; Similarly the survey asks the size of your company and if you read Japanese.&amp;#160; There is no trick to get invited.&amp;#160; &lt;/p&gt;  &lt;p&gt;If you don’t get invited, then don’t fret.&amp;#160; We’ll give you some useful information on this blog and other Office blogs to help you prepare your business for the future.&amp;#160; For now, I encourage you to build great solutions for Office using all of the resources at Microsoft including Visual Studio, VBA, Open XML SDK, code samples, Forum support, Code Gallery, and the &lt;a href="http://msdn.microsoft.com/office" target="_blank"&gt;Office Developer Center&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;Sincerely, Christin Boyd, Program Manager&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9607782" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/vsto/archive/tags/VSTO/default.aspx">VSTO</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Christin+Boyd/default.aspx">Christin Boyd</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Office+2007/default.aspx">Office 2007</category><category domain="http://blogs.msdn.com/vsto/archive/tags/video/default.aspx">video</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Community/default.aspx">Community</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Office+Development/default.aspx">Office Development</category><category domain="http://blogs.msdn.com/vsto/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Office+2010/default.aspx">Office 2010</category></item><item><title>TechEd Sessions on Office Development</title><link>http://blogs.msdn.com/vsto/archive/2009/05/07/teched-sessions-on-office-development.aspx</link><pubDate>Fri, 08 May 2009 00:16:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9594976</guid><dc:creator>VSTO Team</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/vsto/comments/9594976.aspx</comments><wfw:commentRss>http://blogs.msdn.com/vsto/commentrss.aspx?PostID=9594976</wfw:commentRss><description>&lt;p&gt;If you’re going to TechEd in Los Angeles next week, then don’t miss these four sessions:&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;&lt;b&gt;DTL03-INT Meet the Microsoft Visual Studio Team&lt;/b&gt;     &lt;br /&gt;Christin Boyd, &lt;a href="http://blogs.msdn.com/eric_carter/default.aspx" target="_blank"&gt;Eric Carter&lt;/a&gt;, Paul Yuknewicz, Jay Schmelzer, &lt;a href="http://diditwith.net/" target="_blank"&gt;Dustin Campbell&lt;/a&gt;, Jonathan Aneja, &lt;a href="http://blogs.msdn.com/lukeh/" target="_blank"&gt;Luke Hoban&lt;/a&gt;, Igor Zinkovsky, Faisal Nasir, &lt;a href="http://devhawk.net/" target="_blank"&gt;Harry Pierson&lt;/a&gt;, &lt;a href="http://blogs.msdn.com/vbteam/" target="_blank"&gt;Lisa Feigenbaum&lt;/a&gt;     &lt;br /&gt;Mon 5/11&amp;#160; 2:45 PM-4:00 PM | Blue Theater 1     &lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;OFC325&amp;#160; Building Custom Applications in Microsoft Office Outlook 2007&lt;/strong&gt;     &lt;br /&gt;&lt;a href="http://officedeveloper.net/" target="_blank"&gt;Ty Anderson&lt;/a&gt;, Damon Armstrong     &lt;br /&gt;Tue 5/12&amp;#160; 2:45 PM-4:00 PM | Room 408A&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;DTL324 - Microsoft Visual Studio 2010 Overview for the Business Application Developer &lt;/strong&gt;    &lt;br /&gt;Jay Schmelzer     &lt;br /&gt;Tue 5/12 4:30 PM-5:45 PM | Room 515B&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;OFC324&lt;/b&gt;     &lt;br /&gt;&lt;b&gt;Advanced Microsoft Office Word and Excel 2007 Development in Microsoft Visual Studio 2008 with Visual Studio Tools for Office&lt;/b&gt;     &lt;br /&gt;&lt;a href="http://blogs.msdn.com/eric_carter/default.aspx" target="_blank"&gt;Eric Carter&lt;/a&gt;     &lt;br /&gt;Thursday 5/14 1:00PM-2:15PM | Room 515A&lt;/p&gt;  &lt;p&gt;Of course, there are a dozen other sessions that appeal to Office developers and SharePoint developers.&amp;#160; These are the four that I highly recommend.&amp;#160; Originally I was going to list the 3 not-to-be-missed sessions, but then I couldn’t drop any of these from my list, so we have 4 Must See Sessions!&amp;#160; &lt;/p&gt;  &lt;p&gt;If you’re not going to TechEd, then please click the links on these speakers’ names to read their blogs where the will eventually post some of their demo code.&amp;#160; Expect the posts to happen the Monday after their sessions.&amp;#160; In the case of Eric Carter, he would probably love it if you’d buy his book, &lt;a href="http://www.amazon.com/Visual-Studio-Tools-Office-2007/dp/0321533216" target="_blank"&gt;Visual Studio Tools for Office 2007: VSTO for Excel, Word and Outlook&lt;/a&gt;&lt;u&gt;&lt;/u&gt;.&amp;#160; Or you could just download a zip file with all of the of code from the book &lt;a href="http://blogs.msdn.com/eric_carter/archive/2009/03/14/visual-studio-tools-for-office-2007-code-listings.aspx" target="_blank"&gt;here&lt;/a&gt;.&amp;#160; That should keep you busy for a while.&amp;#160; The explanations in the book really do add to the overall value.&amp;#160; I should credit the co-author, Eric Lippert.&amp;#160; Both men are brilliant and funny, and very modest.&amp;#160; At the Holiday Party this year, Eric Carter got up to sing karaoke and astounded us all with a bouncy rendition of “Sesame Street.” &lt;/p&gt;  &lt;p&gt;-Christin Boyd, Program Manager, Visual Studio&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9594976" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/vsto/archive/tags/Outlook+2007/default.aspx">Outlook 2007</category><category domain="http://blogs.msdn.com/vsto/archive/tags/VSTO/default.aspx">VSTO</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Christin+Boyd/default.aspx">Christin Boyd</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Office+2007/default.aspx">Office 2007</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Word+2007/default.aspx">Word 2007</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Excel+2007/default.aspx">Excel 2007</category><category domain="http://blogs.msdn.com/vsto/archive/tags/VB/default.aspx">VB</category><category domain="http://blogs.msdn.com/vsto/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://blogs.msdn.com/vsto/archive/tags/VS2008/default.aspx">VS2008</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Community/default.aspx">Community</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Office+Development/default.aspx">Office Development</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Visual+Studio+2010/default.aspx">Visual Studio 2010</category></item><item><title>Here is a Way to Get the ID of a Built-in Outlook Command Bar Menu (Norm Estabrook)</title><link>http://blogs.msdn.com/vsto/archive/2009/04/30/here-is-a-way-to-get-the-id-of-a-built-in-outlook-command-bar-menu-norm-estabrook.aspx</link><pubDate>Fri, 01 May 2009 00:09:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9581289</guid><dc:creator>VSTO Team</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/vsto/comments/9581289.aspx</comments><wfw:commentRss>http://blogs.msdn.com/vsto/commentrss.aspx?PostID=9581289</wfw:commentRss><description>&lt;p&gt;Recently, a &lt;a href="http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/adee1998-d619-4667-b08c-5038d02c3a0b/?prof=required"&gt;forum poster&lt;/a&gt; asked us how he could add a submenu item to a built-in menu item in Outlook.&amp;#160; Note that these are not controls that appear on the Ribbon of an Outlook item, but rather the menus that drop down from the top of the Outlook Explorer such as the &lt;strong&gt;View&lt;/strong&gt; menu and the &lt;strong&gt;Tools&lt;/strong&gt; menu.&lt;/p&gt;  &lt;p&gt;So one way to do this (In fact the only way that I know of) is to use the example shown in the following MSDN topic - &lt;a href="http://msdn.microsoft.com/en-us/library/ms269110.aspx"&gt;How to: Add Custom Menus and Menu Items to Outlook&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;You can’t just use the example as is. You will need to add a line of code to get a handle to a built-in menu. The following example gets a handle to the &lt;strong&gt;Junk E-Mail&lt;/strong&gt; menu that appears off of the &lt;strong&gt;Actions&lt;/strong&gt; menu of the Outlook Explorer window.&lt;/p&gt;  &lt;p&gt;Office.&lt;span style="color: #2b91af"&gt;CommandBarPopup &lt;/span&gt;junkEmailMenu = (Office.&lt;span style="color: #2b91af"&gt;CommandBarPopup&lt;/span&gt;)    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;this&lt;/span&gt;.Application.ActiveExplorer().CommandBars.FindControl    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; (Office.&lt;span style="color: #2b91af"&gt;MsoControlType&lt;/span&gt;.msoControlPopup, &lt;strong&gt;31353&lt;/strong&gt;, missing, missing);&lt;/p&gt;  &lt;p&gt;Note the ID number shown in the second parameter to the FindControl method. How on earth did I know that the &lt;strong&gt;Junk E-Mail&lt;/strong&gt; menu is the &lt;strong&gt;31353&lt;/strong&gt; menu?&amp;#160; The answer is … Not very easily. In fact to obtain that ID, I wrote a small Outlook add-in that iterates through all menus in Outlook and prints out their corresponding codes.&amp;#160; I figured that I would share this with you in case you ever have a similar scenario.&lt;/p&gt;  &lt;p&gt;Two notes about the sample below: First - this is a C# example, so my apologies to VB’ers. Second - this example is meant to be used in a Visual Studio 2008 Outlook (2007 or 2003) add-in project.&amp;#160; These projects automatically include the appropriate using statements that enable you to use the prefix “Office” in place of “Microsoft.Office.Core” when referring to some objects etc.&lt;/p&gt;  &lt;p&gt;Ok. Here is the code:&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;public partial class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ThisAddIn
&lt;/span&gt;{
    &lt;span style="color: blue"&gt;private void &lt;/span&gt;ThisAddIn_Startup(&lt;span style="color: blue"&gt;object &lt;/span&gt;sender, System.&lt;span style="color: #2b91af"&gt;EventArgs &lt;/span&gt;e)
    {
        Outlook.&lt;span style="color: #2b91af"&gt;Application &lt;/span&gt;app = &lt;span style="color: blue"&gt;this&lt;/span&gt;.Application;
        &lt;span style="color: green"&gt;//Create a new txt file to record controls' list

        &lt;/span&gt;System.IO.&lt;span style="color: #2b91af"&gt;StreamWriter &lt;/span&gt;sw = System.IO.&lt;span style="color: #2b91af"&gt;File&lt;/span&gt;.CreateText
            (&lt;span style="color: #a31515"&gt;@&amp;quot;C:\Outlook Menus.txt&amp;quot;&lt;/span&gt;);

        &lt;span style="color: green"&gt;//loop through Outlook ActiveExplorer CommandBars to get all CommandBars

        &lt;/span&gt;&lt;span style="color: blue"&gt;foreach &lt;/span&gt;(Office.&lt;span style="color: #2b91af"&gt;CommandBarControl &lt;/span&gt;cb &lt;span style="color: blue"&gt;in &lt;/span&gt;app.ActiveExplorer().CommandBars.ActiveMenuBar.Controls)
        {
            PrintMenuItems(cb, sw);
        }

        sw.Close();

    }

    &lt;span style="color: green"&gt;// Recursive method for printing menus and nested menus.
    // Either the menu is a commandbarpopup (contains submenus)
    // Or it is a commandbarbutton (contains no submenus)

    &lt;/span&gt;&lt;span style="color: blue"&gt;private void &lt;/span&gt;PrintMenuItems(&lt;span style="color: blue"&gt;object &lt;/span&gt;menuItem, System.IO.&lt;span style="color: #2b91af"&gt;StreamWriter &lt;/span&gt;sw)
    {
        &lt;span style="color: blue"&gt;if &lt;/span&gt;(menuItem &lt;span style="color: blue"&gt;as &lt;/span&gt;Office.&lt;span style="color: #2b91af"&gt;CommandBarButton &lt;/span&gt;== &lt;span style="color: blue"&gt;null&lt;/span&gt;)
        {
            &lt;span style="color: green"&gt;// This is a menu bar popup control.
            &lt;/span&gt;sw.WriteLine((menuItem &lt;span style="color: blue"&gt;as &lt;/span&gt;Office.&lt;span style="color: #2b91af"&gt;CommandBarPopup&lt;/span&gt;).Caption +
                &lt;span style="color: #a31515"&gt;&amp;quot;\t&amp;quot; &lt;/span&gt;+ (menuItem &lt;span style="color: blue"&gt;as &lt;/span&gt;Office.&lt;span style="color: #2b91af"&gt;CommandBarPopup&lt;/span&gt;).Id.ToString());

            &lt;span style="color: blue"&gt;if &lt;/span&gt;((menuItem &lt;span style="color: blue"&gt;as &lt;/span&gt;Office.&lt;span style="color: #2b91af"&gt;CommandBarPopup&lt;/span&gt;).accChildCount &amp;gt; 0)
            {
                &lt;span style="color: blue"&gt;for &lt;/span&gt;(&lt;span style="color: blue"&gt;int &lt;/span&gt;j = 1; j &amp;lt;= (menuItem &lt;span style="color: blue"&gt;as &lt;/span&gt;Office.&lt;span style="color: #2b91af"&gt;CommandBarPopup&lt;/span&gt;).accChildCount; j++)
                {
                    PrintMenuItems((menuItem &lt;span style="color: blue"&gt;as &lt;/span&gt;Office.&lt;span style="color: #2b91af"&gt;CommandBarPopup&lt;/span&gt;).get_accChild(j), sw);
                }
            }
        }
        &lt;span style="color: blue"&gt;else
        &lt;/span&gt;{
            &lt;span style="color: green"&gt;// Must be a command
            &lt;/span&gt;sw.WriteLine(&lt;span style="color: #a31515"&gt;&amp;quot;\t&amp;quot; &lt;/span&gt;+ (menuItem &lt;span style="color: blue"&gt;as &lt;/span&gt;Office.&lt;span style="color: #2b91af"&gt;CommandBarControl&lt;/span&gt;).Caption +
                &lt;span style="color: #a31515"&gt;&amp;quot;\t&amp;quot; &lt;/span&gt;+ (menuItem &lt;span style="color: blue"&gt;as &lt;/span&gt;Office.&lt;span style="color: #2b91af"&gt;CommandBarControl&lt;/span&gt;).Id.ToString());
        }

    }&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;Enjoy!&lt;/p&gt;

&lt;p&gt;Norm E.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9581289" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/vsto/archive/tags/Outlook+2007/default.aspx">Outlook 2007</category><category domain="http://blogs.msdn.com/vsto/archive/tags/VSTO/default.aspx">VSTO</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Norm+Estabrook/default.aspx">Norm Estabrook</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Command+bars/default.aspx">Command bars</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Office+2007/default.aspx">Office 2007</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Office+2003/default.aspx">Office 2003</category><category domain="http://blogs.msdn.com/vsto/archive/tags/VS2008/default.aspx">VS2008</category><category domain="http://blogs.msdn.com/vsto/archive/tags/add-ins/default.aspx">add-ins</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Office+Development/default.aspx">Office Development</category></item><item><title>Clearing Off Custom Menu Items in Word (Norm Estabrook)</title><link>http://blogs.msdn.com/vsto/archive/2009/04/14/clearing-off-custom-menu-items-in-word-norm-estabrook.aspx</link><pubDate>Tue, 14 Apr 2009 21:37:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9548974</guid><dc:creator>VSTO Team</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/vsto/comments/9548974.aspx</comments><wfw:commentRss>http://blogs.msdn.com/vsto/commentrss.aspx?PostID=9548974</wfw:commentRss><description>&lt;p&gt;Last month I posted &lt;a href="http://blogs.msdn.com/vsto/archive/2009/03/06/my-word-add-in-creates-duplicate-menu-items-make-it-stop-norm-estabrook.aspx"&gt;this article&lt;/a&gt; that described how to prevent your add-in from creating duplicate menu items in Word.&amp;#160; If you have been experimenting with customization contexts, you might have several menu items that appear when you right click a document. The article that I posted shows how to prevent this from happening for your users, but what about removing the items that appear in your instance of Word – the one that you use for testing? &lt;/p&gt;  &lt;p&gt;To clear those off, just add a bit of code to the startup event handler of any old Word add-in.&amp;#160; Set the customization context to each possible culprit (template, document, attached template etc.) and then call the &lt;strong&gt;Reset&lt;/strong&gt; method. Be sure to save the template or document after words.&amp;#160; &lt;/p&gt;  &lt;p&gt;Note - I wouldn’t recommend that you put this code into an add-in that you send out to users as this code will remove all customizations in each context (Even ones that your add-in has not created!).&amp;#160; However, it is a cool way to clear up left over menu items from the instance of Word that you use for testing.&lt;/p&gt;  &lt;p&gt;&lt;span style="color: blue"&gt;private void &lt;/span&gt;ResetShortcutMenu()     &lt;br /&gt;{     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; myApplication.CustomizationContext = myApplication.ActiveDocument;     &lt;br /&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; myApplication.CommandBars[&lt;span style="color: #a31515"&gt;&amp;quot;Text&amp;quot;&lt;/span&gt;].Reset();     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; myApplication.ActiveDocument.Save();     &lt;br /&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; myApplication.CustomizationContext = myApplication.ActiveDocument.get_AttachedTemplate();     &lt;br /&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; myApplication.CommandBars[&lt;span style="color: #a31515"&gt;&amp;quot;Text&amp;quot;&lt;/span&gt;].Reset();     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; ((Word.&lt;span style="color: #2b91af"&gt;Template&lt;/span&gt;)myApplication.ActiveDocument.get_AttachedTemplate()).Save();     &lt;br /&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; myApplication.CustomizationContext = customTemplate;     &lt;br /&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; myApplication.CommandBars[&lt;span style="color: #a31515"&gt;&amp;quot;Text&amp;quot;&lt;/span&gt;].Reset();     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; customTemplate.Save();     &lt;br /&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; myApplication.CustomizationContext = myApplication.NormalTemplate;     &lt;br /&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; myApplication.CommandBars[&lt;span style="color: #a31515"&gt;&amp;quot;Text&amp;quot;&lt;/span&gt;].Reset();     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; myApplication.NormalTemplate.Save();     &lt;br /&gt;}&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9548974" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/vsto/archive/tags/VSTO/default.aspx">VSTO</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Norm+Estabrook/default.aspx">Norm Estabrook</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Office+2007/default.aspx">Office 2007</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Office+2003/default.aspx">Office 2003</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Word+Object+Model/default.aspx">Word Object Model</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Word+2007/default.aspx">Word 2007</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Word+2003/default.aspx">Word 2003</category><category domain="http://blogs.msdn.com/vsto/archive/tags/VS2008/default.aspx">VS2008</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Office+Development/default.aspx">Office Development</category></item><item><title>Building Office Business Applications with Visual Studio</title><link>http://blogs.msdn.com/vsto/archive/2009/02/03/building-office-business-applications-with-visual-studio.aspx</link><pubDate>Tue, 03 Feb 2009 22:01:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9393614</guid><dc:creator>VSTO Team</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/vsto/comments/9393614.aspx</comments><wfw:commentRss>http://blogs.msdn.com/vsto/commentrss.aspx?PostID=9393614</wfw:commentRss><description>&lt;FONT size=2&gt;
&lt;P&gt;This week Microsoft is hosting an internal even called Tech Ready 8 in Seattle.&amp;nbsp;&amp;nbsp;Microsoft technical field reps and product teams come together to talk about&amp;nbsp;all of the great products we're building.&amp;nbsp; I presented a session on Building Office Development Applications with Visual Studio along with a couple team members.&amp;nbsp; In preparation for that session we spent the past week building a demo application that surfaces LOB data exposed as an ADO .NET dataservices in Outlook and Excel clients and SharePoint.&amp;nbsp; Beth Massi is doing a blog series on how we wrote the soloution.&amp;nbsp; &lt;A href="http://blogs.msdn.com/bethmassi/archive/tags/OBA/default.aspx" target=_blank mce_href="http://blogs.msdn.com/bethmassi/archive/tags/OBA/default.aspx"&gt;Check it out.&amp;nbsp;&lt;/A&gt; &lt;/P&gt;&lt;/FONT&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9393614" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/vsto/archive/tags/OBA/default.aspx">OBA</category><category domain="http://blogs.msdn.com/vsto/archive/tags/VS2008/default.aspx">VS2008</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Beth+Massi/default.aspx">Beth Massi</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Office+Development/default.aspx">Office Development</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Rachel+Schaw/default.aspx">Rachel Schaw</category></item></channel></rss>