<?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>Chris Hopkins' Visilog</title><link>http://blogs.msdn.com/chhopkin/default.aspx</link><description>Visio Shape and Solution Development</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Visio 2010 Beta SDK released</title><link>http://blogs.msdn.com/chhopkin/archive/2009/11/30/visio-2010-beta-sdk-released.aspx</link><pubDate>Mon, 30 Nov 2009 20:52:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9930366</guid><dc:creator>chhopkin</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/chhopkin/comments/9930366.aspx</comments><wfw:commentRss>http://blogs.msdn.com/chhopkin/commentrss.aspx?PostID=9930366</wfw:commentRss><description>&lt;p&gt;If you have not yet seen the post on the &lt;a href="http://blogs.msdn.com/visio/" target="_blank"&gt;Visio Insights&lt;/a&gt; blog, &lt;a href="http://blogs.msdn.com/visio/archive/2009/11/19/introducing-the-microsoft-visio-2010-beta-sdk.aspx" target="_blank"&gt;click here to get the beta SDK for Visio 2010&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9930366" width="1" height="1"&gt;</description></item><item><title>Ribbon extensibility for Visio Solutions in Visio 2010</title><link>http://blogs.msdn.com/chhopkin/archive/2009/11/20/ribbon-extensibility-for-visio-solutions-in-visio-2010.aspx</link><pubDate>Fri, 20 Nov 2009 16:09:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9926272</guid><dc:creator>chhopkin</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/chhopkin/comments/9926272.aspx</comments><wfw:commentRss>http://blogs.msdn.com/chhopkin/commentrss.aspx?PostID=9926272</wfw:commentRss><description>&lt;p&gt;Yesterday Microsoft announced the availability of the BETA for Visio 2010.&amp;#160; If you have not seen my blog post on this &lt;a href="http://blogs.msdn.com/chhopkin/archive/2009/11/18/visio-2010-beta-is-here.aspx" target="_blank"&gt;click here&lt;/a&gt; and download your copy of the BETA today.&lt;/p&gt;  &lt;p&gt;Today I want to share with you a guide that I developed which walks you through the process for adding a Ribbon based UI to your VSTO based add-ins.&amp;#160; I also want to share with you a set of sample add-ins which incorporate my best practices for working with ribbons in Visio based add-ins.&lt;/p&gt;  &lt;p&gt;This guide will also point out that you are now able to provide support for both CommandBars and Ribbons in the same add-in so that it can be used in either Visio 2007 or Visio 2010.&amp;#160; Of course this requires that you not make use of any new Visio 2010 APIs, including the new Application.RegisterRibbonX() method which allows you to add a document level ribbon.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/chhopkin/attachment/9926272.ashx"&gt;Get my Visio Ribbon Guide and sample source code here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;My source code samples include:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Application Level sample showing how to add a tab to the ribbon no matter what document is active.&amp;#160; This includes enabling and disabling items on the ribbon tab based on the active document.      &lt;ul&gt;       &lt;li&gt;This also includes a sample showing how to add a tab to the File tab view. &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;   &lt;br /&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Document Level sample showing how to add a tab to the ribbon for a specific document so that it will only be visible/accessible if that document is the active document.      &lt;ul&gt;       &lt;li&gt;This also includes a sample showing how to add your own menu items to the right-click shape menu. &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;   &lt;br /&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;VBA sample that demonstrate how you can use RibbonX with a VBA based solution. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;For additional documentation on ribbon extensibility refer to these sites:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.technet.com/office2010/archive/2009/11/03/ui-extensibility-in-office-2010.aspx" target="_blank"&gt;Backstage extensibility in Office 2010&lt;/a&gt; – This article is a high level overview showing the level of customization that can be accomplished with RibbonX in Office 2010 applications, including Visio 2010 ;-)&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ee692172(office.14).aspx" target="_blank"&gt;Extending the interface in Outlook 2010&lt;/a&gt; – This article is based on Outlook but has many RibbonX samples for various interface items.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/jensenh/archive/2006/12/08/using-ribbonx-with-c-and-atl.aspx" target="_blank"&gt;Using RibbonX with C++ and ATL&lt;/a&gt; – If you are not using .NET take a look at this.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9926272" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/chhopkin/attachment/9926272.ashx" length="1445614" type="application/x-zip-compressed" /></item><item><title>Visio 2010 – Rich icons for your masters</title><link>http://blogs.msdn.com/chhopkin/archive/2009/11/19/visio-2010-rich-icons-for-your-masters.aspx</link><pubDate>Thu, 19 Nov 2009 21:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9925743</guid><dc:creator>chhopkin</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/chhopkin/comments/9925743.aspx</comments><wfw:commentRss>http://blogs.msdn.com/chhopkin/commentrss.aspx?PostID=9925743</wfw:commentRss><description>&lt;p&gt;Visio 2010 adds Live Preview functionality to stencils so that you can provide a rich view of your custom shapes.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/chhopkin/WindowsLiveWriter/Visio2010Richiconsoryourmasters_8928/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/chhopkin/WindowsLiveWriter/Visio2010Richiconsoryourmasters_8928/image_thumb.png" width="228" height="94" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Read this article from the product team to learn how to enable this functionality in your custom stencils, &lt;a href="http://blogs.msdn.com/visio/archive/2009/10/09/live-rendering-shapes-in-visio-2010.aspx" target="_blank"&gt;Live Rendering Shapes in Visio 2010&lt;/a&gt;.    &lt;br /&gt;    &lt;br /&gt;&lt;a href="http://blogs.msdn.com/chhopkin/attachment/9925743.ashx"&gt;Click here to download&lt;/a&gt; a sample stencil that uses this new functionality, demonstrating how you can crop the view to get the best possible images for your masters.    &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9925743" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/chhopkin/attachment/9925743.ashx" length="1165824" type="application/x-zip-compressed" /></item><item><title>What does 64 bit mean for the Visio add-in developer</title><link>http://blogs.msdn.com/chhopkin/archive/2009/11/19/what-does-64-bit-mean-for-the-visio-add-in-developer.aspx</link><pubDate>Thu, 19 Nov 2009 18:58:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9925662</guid><dc:creator>chhopkin</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/chhopkin/comments/9925662.aspx</comments><wfw:commentRss>http://blogs.msdn.com/chhopkin/commentrss.aspx?PostID=9925662</wfw:commentRss><description>&lt;p&gt;With the release of Visio 2010 you have the choice to install either the 32bit version or the 64bit version.&amp;#160; What version you are able to install depends on:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;The target operating system.&amp;#160; In order to install 64bit Visio you must have a 64bit operating system.      &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;The version of Office that you have installed.&amp;#160; Office applications and Visio share common components.&amp;#160; If you have 32bit Office installed you can only install 32bit Visio and vise versa. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;Visual Studio Tools for Office (VSTO)&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;If you are using VSTO as the architecture for your Visio based add-ins you are in luck.&amp;#160; These add-ins are based on managed code (C#, VB.NET, etc) and compile to MSIL, meaning that when the VSTO runtime executes a VSTO add-in, the .NET runtime compiles the MSIL to native code based on the target platform.&amp;#160; In other words, if your add-in is VSTO based then there are no changes that you have to make to your code in order to support both 32 bit and 64 bit versions of Visio 2010.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Anything other than VSTO (VSL, COM add-in, etc.)&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;If you are not using VSTO as the architecture for your Visio based add-ins then you will want to build both 32 bit and 64 bit versions of your add-ins.&lt;/p&gt;  &lt;p&gt;For additional information read this article which explains 32 bit / 64 bit issues in Office 2010    &lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ee691831(office.14).aspx" target="_blank"&gt;Compatibility Between the 32-bit and 64-bit Versions of Office 2010&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;FYI – this article also discusses changes to VBA for the 64 bit environment.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9925662" width="1" height="1"&gt;</description></item><item><title>Visio 2010 BETA is here!</title><link>http://blogs.msdn.com/chhopkin/archive/2009/11/18/visio-2010-beta-is-here.aspx</link><pubDate>Wed, 18 Nov 2009 21:41:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9924737</guid><dc:creator>chhopkin</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/chhopkin/comments/9924737.aspx</comments><wfw:commentRss>http://blogs.msdn.com/chhopkin/commentrss.aspx?PostID=9924737</wfw:commentRss><description>&lt;p&gt;Attention Visio developers, the BETA for Microsoft Visio Premium 2010 has just shipped and can be downloaded from the following links:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=c2163171-4172-4d0a-9f14-2e6da16c027f&amp;amp;displaylang=en" target="_blank"&gt;Microsoft Visio Premium 2010 (x86)&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=90573fc9-25ab-42bb-a922-c2aca21ac094&amp;amp;displaylang=en" target="_blank"&gt;Microsoft Visio Premium 2010 (x64)&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;In you have not visited the Product Team’s blog do so now at &lt;a href="http://blogs.msdn.com/visio"&gt;http://blogs.msdn.com/visio&lt;/a&gt; to read about new functionality directly from the product team.&lt;/p&gt;  &lt;p&gt;But what about the SharePoint 2010 BETA you ask, well that has shipped too.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://technet.microsoft.com/en-us/evalcenter/ee388573.aspx" target="_blank"&gt;Download the Microsoft SharePoint 2010 BETA&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;When you register to download the BETA, make sure you get the Enterprise CAL so that you can check out the new Visio Services functionality…&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/chhopkin/WindowsLiveWriter/Visio2010BETAishere_C06B/image_2.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/chhopkin/WindowsLiveWriter/Visio2010BETAishere_C06B/image_thumb.png" width="583" height="107" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Stay tuned to my blog for more articles on Visio 2010 development including Visio Services development.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9924737" width="1" height="1"&gt;</description></item><item><title>Visio 2010 - Check the Edition at Runtime</title><link>http://blogs.msdn.com/chhopkin/archive/2009/11/12/visio-2010-check-the-edition-at-runtime.aspx</link><pubDate>Thu, 12 Nov 2009 23:25:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9921635</guid><dc:creator>chhopkin</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/chhopkin/comments/9921635.aspx</comments><wfw:commentRss>http://blogs.msdn.com/chhopkin/commentrss.aspx?PostID=9921635</wfw:commentRss><description>&lt;p&gt;With the release of Visio 2007 you could no longer rely on just a check to see if Visio was installed, you also needed to know the Edition or SKU that was installed if you were to use the Data Linking or Data Graphic capabilities via the API.&amp;#160; Now with the release of &lt;strong&gt;Visio 2010&lt;/strong&gt; &lt;strong&gt;Premium&lt;/strong&gt; there is another reason to check the edition at runtime.&lt;/p&gt;  &lt;p&gt;Visio 2010 Premium includes new functionality for rules based validation which is available via the API, however, this functionality and APIs are only available to user of the Premium edition, meaning that if your solution uses these APIs you will need to make sure that they are available before calling them.&lt;/p&gt;  &lt;p&gt;CurrentEdition is a new property that has been added to the Application class which is set to one of the following values at runtime:&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;visEditionStandard      &lt;br /&gt;visEditionProfessional       &lt;br /&gt;visEditionPremium&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;Using this new property you can determine if the running instance of Visio that is hosting your solution supports rules validation.&lt;/p&gt;  &lt;p&gt;Here are two simple properties that you can add to your ThisAddin class (if you are using VSTO) that you can use to:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Check for Data features support:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;internal bool DoesVisioSupportDataFeatures      &lt;br /&gt;{       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; get       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; bool retVal = false; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (this.Application != null &amp;amp;&amp;amp;      &lt;br /&gt;&lt;/font&gt;&lt;font size="2" face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; this.Application.TypelibMinorVersion &amp;gt;= 12)      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; retVal = this.Application.DataFeaturesEnabled;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; } &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return retVal;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;} &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;&lt;/font&gt;&lt;/p&gt; &lt;strong&gt;Check for Process features support:&lt;/strong&gt;   &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;internal bool DoesVisioSupportProcessFeatures      &lt;br /&gt;{       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; get       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; bool retVal = false; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (this.Application != null &amp;amp;&amp;amp;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; this.Application.TypelibMinorVersion &amp;gt;= 14)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (this.Application.CurrentEdition ==       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Visio.VisEdition.visEditionPremium)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; retVal = true;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; } &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return retVal;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;}&lt;/font&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9921635" width="1" height="1"&gt;</description></item><item><title>Customize the Server shape with Visio Guy</title><link>http://blogs.msdn.com/chhopkin/archive/2009/09/28/customize-the-server-shape-with-visio-guy.aspx</link><pubDate>Mon, 28 Sep 2009 23:38:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9900446</guid><dc:creator>chhopkin</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/chhopkin/comments/9900446.aspx</comments><wfw:commentRss>http://blogs.msdn.com/chhopkin/commentrss.aspx?PostID=9900446</wfw:commentRss><description>&lt;p&gt;The Visio Guy site released a new tool that will help you customize the icon on the Server shape that ships with Visio so that you can easily create a server shape that represents your individual needs.&lt;/p&gt;  &lt;p&gt;&lt;img title="visio-server-icon-tool-big" alt="visio-server-icon-tool-big" src="http://www.visguy.com/wp-content/uploads/2009/09/visio-server-icon-tool-big.png" width="268" height="268" /&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.visguy.com/2009/09/11/visio-server-shape-icon-customization-tool/"&gt;Take a look at the article and download the tool today.&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9900446" width="1" height="1"&gt;</description></item><item><title>Visio 2010 Product Team blog</title><link>http://blogs.msdn.com/chhopkin/archive/2009/09/28/visio-2010-product-team-blog.aspx</link><pubDate>Mon, 28 Sep 2009 23:27:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9900442</guid><dc:creator>chhopkin</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/chhopkin/comments/9900442.aspx</comments><wfw:commentRss>http://blogs.msdn.com/chhopkin/commentrss.aspx?PostID=9900442</wfw:commentRss><description>&lt;p&gt;I just wanted to publicize the &lt;a href="http://blogs.msdn.com/visio/default.aspx"&gt;Visio Product team’s blog&lt;/a&gt; which is being updated with important articles about the new features and APIs that will be available with the release of Visio 2010.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9900442" width="1" height="1"&gt;</description></item><item><title>Visio 2007 Add-in for Operations Manager 2007 R2 Released</title><link>http://blogs.msdn.com/chhopkin/archive/2009/09/01/visio-2007-add-in-for-operations-manager-2007-r2-released.aspx</link><pubDate>Tue, 01 Sep 2009 18:36:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9889928</guid><dc:creator>chhopkin</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/chhopkin/comments/9889928.aspx</comments><wfw:commentRss>http://blogs.msdn.com/chhopkin/commentrss.aspx?PostID=9889928</wfw:commentRss><description>&lt;p&gt;Recently we released a new add-in for Visio 2007 that allows you to connect your diagrams to data from an Operations Manager server.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.technet.com/blogfiles/momteam/WindowsLiveWriter/Visio2007AddinforOperationsManager2007R2_AF39/Visio%20Add-in%20Samples%202_2.jpg"&gt;&lt;img style="display: block; float: none; margin-left: auto; margin-right: auto" title="Visio Add-in Samples 2" border="0" alt="Visio Add-in Samples 2" src="http://blogs.technet.com/blogfiles/momteam/WindowsLiveWriter/Visio2007AddinforOperationsManager2007R2_AF39/Visio%20Add-in%20Samples%202_thumb.jpg" width="644" height="431" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;To download this new add-in or to read more details please visit the &lt;a href="http://blogs.technet.com/momteam/archive/2009/07/31/visio-2007-add-in-for-operations-manager-2007-r2-released.aspx"&gt;System Center Operations Manager blog.&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9889928" width="1" height="1"&gt;</description></item><item><title>Adding your .NET DataSet as an External DataRecordset in your Visio diagrams</title><link>http://blogs.msdn.com/chhopkin/archive/2009/07/22/adding-your-net-dataset-as-an-external-datarecordset-in-your-visio-diagrams.aspx</link><pubDate>Wed, 22 Jul 2009 19:06:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9844954</guid><dc:creator>chhopkin</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/chhopkin/comments/9844954.aspx</comments><wfw:commentRss>http://blogs.msdn.com/chhopkin/commentrss.aspx?PostID=9844954</wfw:commentRss><description>&lt;p&gt;Visio 2007 provides the capability to add data to your diagrams from several supported data sources such as Access, Excel, SharePoint, and SQL, etc.&amp;#160; You can also use this capability within your Visio add-ins as the Visio object model provides many objects, methods, and properties for adding, removing, and manipulating DataRecordsets within your add-in.&lt;/p&gt;  &lt;p&gt;Here is some sample code that demonstrates taking a .NET DataTable and adding it to a Visio drawing…&lt;/p&gt;  &lt;p&gt;&lt;span class="rem"&gt;&lt;font color="#008000"&gt;// create a new instance of our DataTable&lt;/font&gt;      &lt;br /&gt;&lt;/span&gt;TeamDataSet.TeamMembersDataTable data = &lt;span class="kwrd"&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt; TeamDataSet.TeamMembersDataTable();&lt;/p&gt;  &lt;p&gt;&lt;span class="rem"&gt;&lt;font color="#008000"&gt;// read the sample data from a file to populate our data table&lt;/font&gt;      &lt;br /&gt;&lt;/span&gt;data.ReadXml(dataPath + &lt;span class="str"&gt;&lt;font color="#008080"&gt;&amp;quot;sample data.xml&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;/p&gt;  &lt;p&gt;&lt;span class="rem"&gt;&lt;font color="#008000"&gt;// convert the .NET DataTable to ADO Recordset XML using this class provided by the Visio 2007 SDK       &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;span class="kwrd"&gt;&lt;font color="#0000ff"&gt;string&lt;/font&gt;&lt;/span&gt; newXmlData = ADONET2ADO.ConvertToAdoRecordsetXml(data);&lt;/p&gt;  &lt;p&gt;&lt;span class="rem"&gt;&lt;font color="#008000"&gt;// create a new datarecordset in our Visio drawing using the converted XML       &lt;br /&gt;&lt;/font&gt;&lt;/span&gt;Visio.DataRecordset newRecordSet = this.VisioDocument.DataRecordsets.AddFromXML(newXmlData, 0, &lt;span class="str"&gt;&lt;font color="#008080"&gt;&amp;quot;Team Members&amp;quot;&lt;/font&gt;&lt;/span&gt;);&lt;/p&gt; &lt;style type="text/css"&gt;

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;  &lt;p&gt;Once this DataRecordset has been added to the document you can open the External Data window to view the data within your diagram and link the records in this DataRecordset to the shapes in your diagrams.&lt;/p&gt;  &lt;p&gt;One issue I do want to point out is a small change that I made to the ADONET2ADO class that shipped with the Visio 2007 SDK.&amp;#160; Attached to this article is an updated version of the ADONET2ADO class that contains one small fix to the TranslateType function for the System.String case.&amp;#160; When the SDK was released this case converted System.String to ADODB.DataTypeEnum.adVarChar but this type does not handle Unicode which is very common with System.String since strings .NET are Unicode based.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/chhopkin/attachment/9844954.ashx"&gt;Click here to download the updated ADONET2ADO class.&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9844954" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/chhopkin/attachment/9844954.ashx" length="2210" type="application/x-zip-compressed" /></item><item><title>New shapes for System Center Operations Manager</title><link>http://blogs.msdn.com/chhopkin/archive/2009/07/20/new-shapes-for-system-center-operations-manager.aspx</link><pubDate>Mon, 20 Jul 2009 19:20:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9841864</guid><dc:creator>chhopkin</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/chhopkin/comments/9841864.aspx</comments><wfw:commentRss>http://blogs.msdn.com/chhopkin/commentrss.aspx?PostID=9841864</wfw:commentRss><description>&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/chhopkin/WindowsLiveWriter/NewshapesforSystemCenterOperationsManage_8337/image_6.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/chhopkin/WindowsLiveWriter/NewshapesforSystemCenterOperationsManage_8337/image_thumb_2.png" width="590" height="361" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The System Center forum hosts a download that contains three new stencils dedicated to System Center Operations Manager.&amp;#160; These stencils contain approximately 64 shapes&lt;/p&gt;  &lt;p&gt;You can easily add these stencils to your My Shapes menu by unzipping the content of the download into your My Shapes folder under My Documents (XP) or Documents (Vista)…&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/chhopkin/WindowsLiveWriter/NewshapesforSystemCenterOperationsManage_8337/image_4.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/chhopkin/WindowsLiveWriter/NewshapesforSystemCenterOperationsManage_8337/image_thumb_1.png" width="616" height="367" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/chhopkin/WindowsLiveWriter/NewshapesforSystemCenterOperationsManage_8337/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/chhopkin/WindowsLiveWriter/NewshapesforSystemCenterOperationsManage_8337/image_thumb.png" width="673" height="138" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Each shape is a high quality raster based image with no shape data or data graphics attached so you have a fresh canvas to build your Operations Manager diagrams.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.systemcenterforum.org/downloads/visio-stencils-for-system-center-operations-manager-2007/"&gt;Click here to download the System Center Operations Manager shapes.&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9841864" width="1" height="1"&gt;</description></item><item><title>Rotate text on Timeline shapes</title><link>http://blogs.msdn.com/chhopkin/archive/2009/06/03/rotate-text-on-timeline-shapes.aspx</link><pubDate>Wed, 03 Jun 2009 21:16:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9692060</guid><dc:creator>chhopkin</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/chhopkin/comments/9692060.aspx</comments><wfw:commentRss>http://blogs.msdn.com/chhopkin/commentrss.aspx?PostID=9692060</wfw:commentRss><description>&lt;P&gt;I recently received a request from a user who wanted the ability to:&lt;/P&gt;
&lt;P&gt;1. rotate the text for the Bracket Interval shape to an angle such as 45deg. &lt;BR&gt;2. display the interval name above the date instead of below.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/chhopkin/WindowsLiveWriter/RotatetextonTimelineshapes_9E9A/image_2.png" mce_href="http://blogs.msdn.com/blogfiles/chhopkin/WindowsLiveWriter/RotatetextonTimelineshapes_9E9A/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/chhopkin/WindowsLiveWriter/RotatetextonTimelineshapes_9E9A/image_thumb.png" width=404 height=298 mce_src="http://blogs.msdn.com/blogfiles/chhopkin/WindowsLiveWriter/RotatetextonTimelineshapes_9E9A/image_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;I took the built-in shape and customized it to support these two requirements, allowing you to have a Bracket Interval shape that looks like this…&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/chhopkin/WindowsLiveWriter/RotatetextonTimelineshapes_9E9A/image_4.png" mce_href="http://blogs.msdn.com/blogfiles/chhopkin/WindowsLiveWriter/RotatetextonTimelineshapes_9E9A/image_4.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/chhopkin/WindowsLiveWriter/RotatetextonTimelineshapes_9E9A/image_thumb_1.png" width=312 height=441 mce_src="http://blogs.msdn.com/blogfiles/chhopkin/WindowsLiveWriter/RotatetextonTimelineshapes_9E9A/image_thumb_1.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;This new shape has an additional right-click menu item that toggles the text from ‘Horizontal Text’ to ‘Angled Text’.&amp;nbsp; When set to ‘Angled Text’ a new control handle appears that allows you to set the angle of the text.&lt;/P&gt;
&lt;P&gt;Feel free to &lt;A href="http://blogs.msdn.com/chhopkin/attachment/9692060.ashx" mce_href="http://blogs.msdn.com/chhopkin/attachment/9692060.ashx"&gt;download&lt;/A&gt; my Visio diagram that contains this new shape and use this shape in your timeline diagrams.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9692060" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/chhopkin/attachment/9692060.ashx" length="136704" type="application/vnd.visio" /></item><item><title>Visio Slide Show</title><link>http://blogs.msdn.com/chhopkin/archive/2009/05/21/visio-slide-show.aspx</link><pubDate>Thu, 21 May 2009 19:42:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9633978</guid><dc:creator>chhopkin</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/chhopkin/comments/9633978.aspx</comments><wfw:commentRss>http://blogs.msdn.com/chhopkin/commentrss.aspx?PostID=9633978</wfw:commentRss><description>&lt;p&gt;&lt;em&gt;(updated 6/11/09 – added support for a dialog to allow you to set the interval between slides)&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;Recently I was asked if it was possible to set a timer to automatically switch to the next page when in full screen mode, producing a slide show style presentation mode.&lt;/p&gt;  &lt;p&gt;I decided to do this using VBA as this code can easily be added to any Visio document that needs this functionality.&lt;/p&gt;  &lt;p&gt;FYI, when the slide show macro is running and the last page in the document is reached, the slide show will continue with the first page via a continuous loop.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;To add this functionality to your document:&lt;/strong&gt;&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Open your document      &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;Open the Visual Basic editor, ALT + F11 or from the Tools &amp;gt; Macro &amp;gt; Visual Basic Editor menu item      &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;Paste the code below into the ThisDocument module via the Visual Basic editor      &lt;br /&gt;      &lt;br /&gt;      &lt;ol&gt;       &lt;li&gt;By default the editor opens the ThisDocument module.          &lt;br /&gt;          &lt;br /&gt;&lt;a href="http://blogs.msdn.com/blogfiles/chhopkin/WindowsLiveWriter/VisioSlideShow_8865/image_4.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/chhopkin/WindowsLiveWriter/VisioSlideShow_8865/image_thumb_1.png" width="364" height="193" /&gt;&lt;/a&gt; &lt;/li&gt;     &lt;/ol&gt;   &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&lt;strong&gt;Start the slide show&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;From the Tools &amp;gt; Macros &amp;gt; ThisDocument menu select &lt;strong&gt;StartSlideShow&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/chhopkin/WindowsLiveWriter/VisioSlideShow_8865/image_10.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/chhopkin/WindowsLiveWriter/VisioSlideShow_8865/image_thumb_3.png" width="577" height="140" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Stop the slide show&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Simply press the &lt;strong&gt;ESC&lt;/strong&gt; key.&amp;#160; This will exit full screen mode and also trigger the timer in the macro to stop, returning you to the Visio application window.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Set the Interval&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;From the Tools &amp;gt;Macros &amp;gt; ThisDocument menu select &lt;strong&gt;SetInterval&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/chhopkin/WindowsLiveWriter/VisioSlideShow_8865/image_8.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/chhopkin/WindowsLiveWriter/VisioSlideShow_8865/image_thumb.png" width="582" height="140" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Download the Visio diagram that contains this code &lt;a title="Visio Slide Show VBA Code" href="http://blogs.msdn.com/chhopkin/attachment/9633978.ashx"&gt;here&lt;/a&gt;.&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Here is the VBA code:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;span class="kwrd"&gt;Option&lt;/span&gt; Explicit    &lt;br /&gt;    &lt;br /&gt;&lt;span class="kwrd"&gt;Private&lt;/span&gt; &lt;span class="kwrd"&gt;WithEvents&lt;/span&gt; g_vsoApplication &lt;span class="kwrd"&gt;As&lt;/span&gt; Visio.Application    &lt;br /&gt;    &lt;br /&gt;&lt;span class="kwrd"&gt;Private&lt;/span&gt; g_interval &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt;    &lt;br /&gt;&lt;span class="kwrd"&gt;Private&lt;/span&gt; &lt;span class="kwrd"&gt;Const&lt;/span&gt; DEFAULT_INTERVAL &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt; = 5    &lt;br /&gt;    &lt;br /&gt;&lt;span class="kwrd"&gt;Private&lt;/span&gt; g_fullScreen &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Boolean&lt;/span&gt;    &lt;br /&gt;    &lt;br /&gt;&lt;span class="kwrd"&gt;Public&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; SetInterval()    &lt;br /&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span class="kwrd"&gt;Dim&lt;/span&gt; entryVal &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;String&lt;/span&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span class="kwrd"&gt;Dim&lt;/span&gt; entryError &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Boolean&lt;/span&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;reEnterValue:    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span class="rem"&gt;' init our error flag&lt;/span&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; entryError = &lt;span class="kwrd"&gt;False&lt;/span&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span class="rem"&gt;' determine if we show the default value or the last entered value&lt;/span&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span class="kwrd"&gt;Dim&lt;/span&gt; initVal &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span class="kwrd"&gt;If&lt;/span&gt; &lt;span class="kwrd"&gt;Not&lt;/span&gt; (g_interval = DEFAULT_INTERVAL) &lt;span class="kwrd"&gt;And&lt;/span&gt; &lt;span class="kwrd"&gt;Not&lt;/span&gt; (g_interval = 0) &lt;span class="kwrd"&gt;Then&lt;/span&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; initVal = g_interval    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span class="kwrd"&gt;Else&lt;/span&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; initVal = DEFAULT_INTERVAL    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;If&lt;/span&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span class="rem"&gt;' get a new value from the user&lt;/span&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; entryVal = InputBox(&lt;span class="str"&gt;&amp;quot;Enter the interval (in seconds 1 - 60)&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;Set Slide Show interval&amp;quot;&lt;/span&gt;, initVal)    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span class="kwrd"&gt;If&lt;/span&gt; Len(entryVal) = 0 &lt;span class="kwrd"&gt;Then&lt;/span&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="rem"&gt;' the user pressed cancel&lt;/span&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="kwrd"&gt;Exit&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;If&lt;/span&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span class="kwrd"&gt;Dim&lt;/span&gt; tmpInterval &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span class="kwrd"&gt;If&lt;/span&gt; IsNumeric(entryVal) &lt;span class="kwrd"&gt;Then&lt;/span&gt;    &lt;br /&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; tmpInterval = Conversion.&lt;span class="kwrd"&gt;CInt&lt;/span&gt;(entryVal)    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="kwrd"&gt;If&lt;/span&gt; tmpInterval &amp;lt; 1 &lt;span class="kwrd"&gt;Or&lt;/span&gt; tmpInterval &amp;gt; 60 &lt;span class="kwrd"&gt;Then&lt;/span&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; entryError = &lt;span class="kwrd"&gt;True&lt;/span&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;If&lt;/span&gt;    &lt;br /&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span class="kwrd"&gt;Else&lt;/span&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; entryError = &lt;span class="kwrd"&gt;True&lt;/span&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;If&lt;/span&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span class="kwrd"&gt;If&lt;/span&gt; entryError &lt;span class="kwrd"&gt;Then&lt;/span&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; MsgBox &lt;span class="str"&gt;&amp;quot;Please enter a value between 1 - 60&amp;quot;&lt;/span&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="kwrd"&gt;GoTo&lt;/span&gt; reEnterValue    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;If&lt;/span&gt;    &lt;br /&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; g_interval = tmpInterval    &lt;br /&gt;    &lt;br /&gt;&lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt;    &lt;br /&gt;    &lt;br /&gt;&lt;span class="kwrd"&gt;Public&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; StartSlideShow()    &lt;br /&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span class="kwrd"&gt;Set&lt;/span&gt; g_vsoApplication = Application    &lt;br /&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span class="kwrd"&gt;Dim&lt;/span&gt; iNextPage &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Integer&lt;/span&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; iNextPage = 1    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span class="rem"&gt;' set the first page&lt;/span&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; ActiveWindow.Page = ThisDocument.Pages(iNextPage)    &lt;br /&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span class="rem"&gt;' enter full screen mode&lt;/span&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; Application.DoCmd visCmdFullScreenMode    &lt;br /&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; g_fullScreen = &lt;span class="kwrd"&gt;True&lt;/span&gt;    &lt;br /&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span class="kwrd"&gt;Do&lt;/span&gt; &lt;span class="kwrd"&gt;While&lt;/span&gt; g_fullScreen    &lt;br /&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="rem"&gt;' start timer&lt;/span&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="kwrd"&gt;Dim&lt;/span&gt; pTime, pStart, pEnd, tTime, lTime    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="rem"&gt;'five second loop&lt;/span&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; pTime = g_interval    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; pStart = Timer    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="kwrd"&gt;Do&lt;/span&gt; &lt;span class="kwrd"&gt;While&lt;/span&gt; (Timer &amp;lt; pStart + pTime) &lt;span class="kwrd"&gt;And&lt;/span&gt; g_fullScreen = &lt;span class="kwrd"&gt;True&lt;/span&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; DoEvents    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lTime = (pStart + pTime) - Timer    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="kwrd"&gt;Loop&lt;/span&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="rem"&gt;' get the next page index that we need to switch to&lt;/span&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="kwrd"&gt;If&lt;/span&gt; iNextPage = ThisDocument.Pages.Count &lt;span class="kwrd"&gt;Then&lt;/span&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; iNextPage = 0    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;If&lt;/span&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; iNextPage = iNextPage + 1    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="rem"&gt;' get the next page and switch to it&lt;/span&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="kwrd"&gt;Dim&lt;/span&gt; vsoNextPage &lt;span class="kwrd"&gt;As&lt;/span&gt; Visio.Page    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="kwrd"&gt;Set&lt;/span&gt; vsoNextPage = ThisDocument.Pages(iNextPage)    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ActiveWindow.Page = vsoNextPage    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span class="rem"&gt;' reset timer&lt;/span&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; pEnd = Timer    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; tTime = pEnd - pStart    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span class="kwrd"&gt;Loop&lt;/span&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt;    &lt;br /&gt;    &lt;br /&gt;&lt;span class="kwrd"&gt;Private&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt; g_vsoApplication_KeyPress(&lt;span class="kwrd"&gt;ByVal&lt;/span&gt; KeyAscii &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Long&lt;/span&gt;, CancelDefault &lt;span class="kwrd"&gt;As&lt;/span&gt; &lt;span class="kwrd"&gt;Boolean&lt;/span&gt;)    &lt;br /&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span class="rem"&gt;' kill the code on any keypress&lt;/span&gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; g_fullScreen = &lt;span class="kwrd"&gt;False&lt;/span&gt;    &lt;br /&gt;    &lt;br /&gt;&lt;span class="kwrd"&gt;End&lt;/span&gt; &lt;span class="kwrd"&gt;Sub&lt;/span&gt;    &lt;br /&gt;&lt;/p&gt; &lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;style type="text/css"&gt;

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9633978" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/chhopkin/attachment/9633978.ashx" length="83636" type="application/x-zip-compressed" /></item><item><title>State management for CommandBars v2.0</title><link>http://blogs.msdn.com/chhopkin/archive/2009/05/08/state-management-for-commandbars-v2-0.aspx</link><pubDate>Fri, 08 May 2009 21:04:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9597427</guid><dc:creator>chhopkin</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/chhopkin/comments/9597427.aspx</comments><wfw:commentRss>http://blogs.msdn.com/chhopkin/commentrss.aspx?PostID=9597427</wfw:commentRss><description>&lt;p&gt;After I posted my source for managing CommandBarButton and CommandBarPopup objects I received a few requests to include management of CommandBarButtons that control the state of AnchorBar windows.&lt;/p&gt;  &lt;p&gt;As you know you can add your own windows within the Visio drawing window, similar to the Shape Data window.&amp;#160; These type of windows are typically controlled via a menu item that toggles its state or caption depending on the visible state of the window.&amp;#160; For example, the caption of the menu item changes or the visual state or the menu item switches between a pushed or unpushed state.&lt;/p&gt;  &lt;p&gt;Good news.&amp;#160; I updated my CommandBar management code to support this functionality.&lt;/p&gt;  &lt;p&gt;Included in this update is my new VisioCommandBarButtonForAnchorWindow class.&amp;#160; This new class contains the functionality for toggling either the Caption property or the State property of the CommandBarButton based on the Visible state of your AnchorBar window.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Getting Started&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;After you download this source you should be able to compile it and run it.&amp;#160; You will need VS 2008, VSTO 3.0, and Visio 2007.&amp;#160; Visio 2007 will also need to have .NET Programmability Support installed (PIA).&lt;/p&gt;  &lt;p&gt;Feel free to add the UIMgr.cs and the VisioCommandBars.cs source files to your own project.&amp;#160; In most cases all you will need to do is change the AddUI method to add your specific CommandBarButtons or PopUps.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/chhopkin/attachment/9597427.ashx"&gt;Click here&lt;/a&gt; to download the sample VSTO based add-in that demonstrates how these wrapper classes are used, along with the full source to the wrapper classes.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9597427" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/chhopkin/attachment/9597427.ashx" length="39655" type="application/x-zip-compressed" /></item><item><title>Check before you customize CommandBars…</title><link>http://blogs.msdn.com/chhopkin/archive/2009/05/07/check-before-you-customize-commandbars.aspx</link><pubDate>Thu, 07 May 2009 18:40:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9593849</guid><dc:creator>chhopkin</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/chhopkin/comments/9593849.aspx</comments><wfw:commentRss>http://blogs.msdn.com/chhopkin/commentrss.aspx?PostID=9593849</wfw:commentRss><description>&lt;p&gt;Recently I have noticed a few add-ins that lock customization on the MenuBar object after the add-in has made its changes, i.e. adding a custom menu.&amp;#160; There are valid reasons for using this functionality but you also have to consider the impact to other add-ins that may be installed.&lt;/p&gt;  &lt;p&gt;Example:   &lt;br /&gt;menuBar.Protection = MsoBarProtection.msoBarNoCustomize&lt;/p&gt;  &lt;p&gt;If you are setting the Protection property on the MenuBar object you are preventing the user from being able to make modifications to the entire MenuBar object.&amp;#160; This will protect your custom menu but it will also prevent any other add-ins from making changes to the MenuBar object.&lt;/p&gt;  &lt;p&gt;If another add-in attempts to customize the CommandBars after this property is set the add-in will receive the following exception, which is not easily interpreted as a protection issue…&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/chhopkin/WindowsLiveWriter/CheckbeforeyoucustomizeCommandBars_79F1/clip_image002_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image002" border="0" alt="clip_image002" src="http://blogs.msdn.com/blogfiles/chhopkin/WindowsLiveWriter/CheckbeforeyoucustomizeCommandBars_79F1/clip_image002_thumb.jpg" width="244" height="92" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Error HRESULT E_FAIL has been returned from a call to a COM component.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Best Practices&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;1. Do not set the &lt;strong&gt;Protection&lt;/strong&gt; property of the &lt;strong&gt;MenuBar&lt;/strong&gt; object unless it is absolutely necessary.&amp;#160; Rather than setting this property add the additional logic to manage your CommandBar objects.&amp;#160; For example, check to see if your UI changes exist and if not simply add them back.&amp;#160; I typically do this when my add-in is first loaded.&lt;/p&gt;  &lt;p&gt;2. I started adding the following code to all of my add-ins.&amp;#160; Before I attempt to make modifications to the CommandBar objects I check the Protection property and reset it to &lt;strong&gt;msoBarNoCustomize&lt;/strong&gt; before attempting to make my changes.&amp;#160; This ensures that my add-in is able to make changes to the CommandBar objects.&lt;/p&gt;  &lt;pre class="csharpcode"&gt;...
CommandBars commandBars = Globals.ThisAddIn.Application.CommandBars &lt;span class="kwrd"&gt;as&lt;/span&gt; CommandBars;
CommandBar menuBar = commandBars[&lt;span class="str"&gt;&amp;quot;Menu Bar&amp;quot;&lt;/span&gt;] &lt;span class="kwrd"&gt;as&lt;/span&gt; CommandBar;

&lt;span class="kwrd"&gt;if&lt;/span&gt; ((menuBar.Protection &amp;amp; MsoBarProtection.msoBarNoCustomize) == MsoBarProtection.msoBarNoCustomize)
{
&lt;span class="rem"&gt;    // make sure we can always add out UI&lt;/span&gt;
    menuBar.Protection = MsoBarProtection.msoBarNoProtection;
}
...&lt;/pre&gt;
&lt;style type="text/css"&gt;

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9593849" width="1" height="1"&gt;</description></item></channel></rss>