Visio has been around for over 15 years, and there have been many product versions released. One of the biggest issues that can impact users from release to release is a file format change. Changes in Visio's file format can be painful for customers because people must often share documents with others who are using a different version of the product. Let's look at this issue in depth.
Until recently Visio changed its file format with every major release. This change was not as painful for customers as it is today because most people exchanged drawings within a much smaller circle of users - usually others in the same department who would have the same version of Visio installed. As Visio gained more customers and those customers shared their drawings with other groups, version incompatibility became more commonplace.
Visio file format history
Default file format
Backward save format
Visio 4.0, Visio 4.1, Visio 4.5
Visio 5.0, Visio 5.0 Plus
Visio 2000, Visio 2002
Visio 2003, Visio 2007
Visio 2002 was the first major release to maintain the same file format as the previous release. Visio 2003 once again introduced a new file format. Visio 2007 will use the same format as Visio 2003. Every version of Visio is capable of reading all older files. Visio 2007 can open a Visio 1.0 document. Generally, each version of Visio is capable of writing back one file version as well. Thus Visio 2003 can save a file out in 6.0 format (readable by Visio 2000 and Visio 2002), but it cannot save out a 5.0 format or earlier. When saving to an older format, some features and information may be lost if the older Visio does not support those features.
Why change the file format? To add features and new capabilities. Visio 2000 introduced a new file format to allow vastly larger and more complex diagrams to be created. Internal limits on the number of shapes and other items were removed. The most recent change for Visio 2003 was required to introduce Unicode text throughout the application, though we took advantage of the change to build in some other great features as well.
Will the file format change again in the future? It might, but Visio must be mindful of the problems a change can cause for customers. Word, Excel and PowerPoint have a new file format in Office 2007. One of the things Microsoft is doing to make this transition go more smoothly is to release a compatibility update to Office 2000, XP and 2003. Those versions can then read and write the new format. Perhaps Visio should consider this approach.
In the meantime, how do you deal with file incompatibilities? The first option is to have the document author save the drawing as an older file version. A second option is for the document author to publish the drawing using the Save As Web Page feature. If you have received a document that was created in a newer version, you can also download the free Visio Viewer to at least view and print the document. File incompatibility can be frustrating, but hopefully you now know what versions of Visio work with each format.
Our Product Planning team would like to hear from those who share diagrams by putting them on a Web site, SharePoint site or file server. Are you sharing diagrams connected to data sources (perhaps through the new Data Link and Data Graphics features in Visio 2007)? We'd like to better understand how our customers share diagrams inside their organizations.
If you would like to help us with this area, please contact us.
One of the first things you’ll notice when you start Visio 2010 is the new getting started screen, which is where you’ll choose a template for the diagram you plan to create. While it’s similar to the “Getting Started with Microsoft Office Visio” screen that greets users of Visio 2007, it’s actually part of the new Microsoft Office Backstage View that is common to all Office 2010 applications.
The Backstage View is the location for features that interact with the Visio file as a whole, such as opening, saving, printing, and setting file properties, as well as settings and information for the application. Since these are features that don’t need to be visible all the time while you’re building a diagram on the Visio drawing canvas, they are located in the Backstage View.
The Backstage View consists of a set of tabs that group related features. In addition to the “New” tab, which is the one that appears when you launch Visio, there are tabs labeled “Info”, “Recent”, “Print”, “Share”, and “Visio”. Each tab can be accessed by clicking on its label in the navigation pane on the left side of the screen. We will have more to say about the other tabs in a future post.
The “New” tab is where you get started on a diagram by picking a template from one of the available template categories. The templates you use appear in a “Recently Used Templates” section at the top of the '”Home” screen for quick access. Navigation in the template categories is similar to that in a Web browser, with back, forward, and Home buttons at the top.
In addition to choosing a template, the “New” tab lets you start a new diagram without a template by clicking on “Blank Drawing” at the bottom of the screen. You can also access the Office Online templates, open the sample diagrams, or start a new diagram from any existing Visio file.
If you would rather get started by opening a file you worked on previously, the “Recent” tab provides access to the list of most recently opened Visio files, each with a thumbnail preview. Files can be pinned to the top of the list for quicker access.
Once you’re working on a diagram on the Visio drawing canvas, the Backstage View can be accessed at anytime by clicking the left-most tab in the Ribbon, which is labeled with the Office logo.
We are interested in your feedback on the new getting started experience in the Visio 2010 Technical Preview, so use the Send a Smile feedback tool or comment on the blog to let us know what you think.
Windows 7 is here, and it makes it easier to find and work with your favorite applications. This post details the work we did in Visio 2010 to take advantage of new Windows 7 features, to make working with Visio documents even easier.
The new Windows 7 taskbar presents a unified interface for launching and switching between applications and documents within them. With Windows 7 and Visio 2010, it is now easier to work with multiple Visio documents at the same time.
We received lots of feedback on the Technical Preview asking for the ability to preview open Visio documents as multiple taskbar items. We listened, and now in the Visio 2010 Beta you can see previews of each Visio document directly from the taskbar, similar to Word and PowerPoint:
By clicking on a thumbnail, you can switch directly to a specific Visio document. If you hover over a thumbnail, Windows shows you a full-size preview of what that window looks like, through a feature called Aero Peek. With Visio 2010 and Windows 7, working with multiple documents at the same time is simple.
For more on the Windows 7 task bar, see this blog post on the Engineering Windows 7 Blog.
Another common request we receive is to enable Visio documents to be edited on separate monitors, similar to Word and PowerPoint. While Visio still displays multiple documents in the same application window, there is a workaround to enable dual display support: launch two instances of Visio.
You can do this in Windows 7 by launching Visio, and then right clicking the Visio icon and clicking on the “Microsoft Visio 2010” item. This will launch a second instance of Visio.
Now that you have two instances running, move one instance of Visio to your second monitor. You can then open two separate files in two separate windows. Even though you’re running two instances of Visio, they are both represented by the same icon in the Windows 7 taskbar, so it’s easy to switch between documents.
If you have a touch-enabled device, Windows 7 allows you to interact with your PC with your fingers. This feature, called Windows Touch, brings a set of gestures to the operating system that can be used in the OS and several applications.
We’ve integrated support for several Windows Touch gestures in Visio 2010:
The above scenarios work directly on the drawing surface, and in full screen mode! Check out the video below to see multi touch in action! (Note: there is no audio).
As seen in the video, we have also integrated the same touch support in the Visio Viewer and in Outlook 2010 preview mode. If you receive a Visio diagram as an attachment, you can use these touch gestures to navigate the diagram directly in Outlook 2010. Click here for more information about Windows Touch
As usual, feel free to drop us a comment on the blog or use the Send a Smile feature in the Visio 2010 Beta to let us know what you think.
Visio Services allows you to view Visio diagrams in SharePoint, and the Visio Web Access web part allows you to embed those diagrams on a web part page. This post examines how you can turn those diagrams into interactive mashups without having to write any code.
This post will show you a few examples of mashups with Visio Services and web part connections, and then it will explain how you can create your own mashups. We’ll finish off by detailing all the web part connection options available and some ideas for you to explore.
In our first example, we use web part connections to visually filter a Visio diagram using a SharePoint list. Visio Services allows you to display dynamic data connected diagrams. If your diagrams are using SharePoint lists as a data source, you can use the list view web part to filter the Visio diagram. As you apply filters to the list, the shapes in the Visio diagram corresponding to the rows in your list view are highlighted.
Below is a screenshot of a network diagram embedded on a web part page. The data is coming from a SharePoint list, and the list view web part is placed next to the Visio Web Access web part, showing some of the data in that list:
When you apply filters to the list, Visio Web Access highlights the shapes that correspond to the rows remaining in the list. So if you want to highlight all the servers that are from a specific manufacturer, or are running a specific operating system, it’s easy to do so. Here’s a screenshot of what happens when you choose to filter and only show servers from one manufacturer:
Notice that there are fewer rows in the list view web part, and that some of the shapes in the Visio Web Access web part are now highlighted with a red border.
You can easily apply multiple filters and clear them to focus your attention on a specific set of shapes. Using this method of visually filtering a diagram, you can look for trends in your data connected diagrams by highlighting a subset of your shapes.
You can also connect two Visio Web Access web parts on the same page to create a master detail view. When you click on a shape in the “master” web part, the “detail” web part displays related information. This is especially useful if you have a complicated process diagram that has several sub-processes, or anytime you want to show detail without losing high-level context.
The image below shows a web part page with two Visio Web Access web parts. The top web part is showing the high level process, and the bottom web part is showing more detail.
Notice in the above image that “Phase 1” is selected. When you click on a different phase in the top web part, the bottom web part updates to show you more information. This is what clicking on Phase 3 results in:
To show you how to setup a web part connection with Visio Web Access, let’s take a detailed look at a third scenario. In addition to being able to highlight shapes based on filters, you can also highlight shapes by setting up a list that contains the names of the shapes you want to highlight. This gives you more flexibility without needing to use the API. The picture below illustrates this. The list on the right contains 3 rows. Each row contains a column with a list of shapes. When you select a row, the corresponding shapes are highlighted.
Notice in the above picture that the first row in the list is selected, and the corresponding shapes are highlighted. Also notice that the second column in the list contains a comma-delimited list of shape names, e.g. “Process,Process.34,Process.70,Process.134”. You can easily hide this column from the view, but it is included here to illustrate the example.
When you change the selected row, different shapes are highlighted:
The following set of instructions show you how to setup the example described above with your own diagram:
You can also setup this connection using SharePoint Designer (SPD). The experience is very similar to the one described above. In the example above, we showed you how to map a field from the consumer web part to the provider web part. Some web part connection actions allow you to specify multiple fields or parameters. To map multiple fields, you should use SPD.
The examples above illustrated a few things you can do with web part connections and Visio Web Access. The list below details the five different connection options supported by Visio Web Access. Some connection actions allow you to specify multiple fields or parameters.
This connection action was used in the Master/Detail example above.
This connection action allows you to send shape data to another web part. When a shape is selected in the Web diagram, data from that shape is sent as a row. By default, the following shape data items are always sent:
To specify additional shape data items to send, open the Web Part tool pane. Type the labels of the shape data items as a comma-delimited list in the box labeled Expose the following shape data items to web part connections.
This connection action was also used in the Master/Detail example above.
This connection action allows you to load a web drawing or switch the displayed page. It takes two parameters:
Visio Web Access will load the web diagram at the specified URL, and switch to the page name specified. If no URL is specified, and only a page name, then it will switch to that page on the diagram that is currently open. If no page name is specified, then the default page will be loaded at the specified URL.
This connection action was used in the highlighting shapes example above.
This connection allows you to highlight shapes in a diagram. It takes two parameters:
When the connected web part sends a shape name or a list of names, Visio Web Access highlights those shapes with the specified highlight color. If no color is specified, a default color is used.
This connection action was used in the “filtering a diagram” example above.
This connection action allows you to “filter” a Visio diagram that is connected to a SharePoint list. The connected web part must contain a SharePoint list that is being used as a data source in the diagram. When the SharePoint list is filtered, the diagram highlights the shapes that correspond to visible results in the filtered SharePoint list. The diagram must be connected to the SharePoint list that the connected Web Part is displaying. For more info on how to create a data connected diagram, see this video.
This connection action allows you to change the view and zoom of the diagram displayed in the Visio Web Access web part. It takes two parameters:
When the connected web part sends a shape name, the Visio Web Access web part centers the view on the specified shape with the zoom level. If no zoom level is sent, then the current zoom percentage is used. You might use this if you have a large diagram and you want to create pre-defined views. For example, if you have a large floor plan, you might setup pre-defined views for different areas of the building.
We’ve shown three examples here of how you can use Visio diagrams and web part connections to create mashups. Here are some other ideas you might try creating yourself:
Web part connections allows end-users, pro-users, and developers to create quick mashups that would otherwise require writing code. We’re interested in hearing what you think of this functionality, please use the Send a Smile feedback tool or leave a comment below.
In our last post, we talked about Visio Services--a new feature of SharePoint 2010 that extends the reach of Visio diagrams considerably. Visio Services lets you:
In this post, we explain how to create a Visio Web Drawing (*.VDW) file using Visio Professional 2010 or Visio Premium 2010. The Visio Web Drawing (*.VDW) is a new Visio file type that allows diagrams to be rendered in full fidelity in the browser using Visio Services on SharePoint 2010.
When you save a file in Visio 2010, you will see the option in the Save As dialog to save your diagram as a Web Drawing.
You can also easily create a Visio Web Drawing using the Save to SharePoint billboard on the Share tab of the Backstage View. This billboard allows you to quickly select a SharePoint location and the Web Drawing file type for saving your diagram.
Clicking on Save to SharePoint at the bottom of the billboard opens the Save As dialog so you can confirm or refine your selection.
To use the default publishing options, press Save. You now have a diagram ready for viewing in the browser!
By default, Visio automatically opens a browser so you can see your diagram as others will see it in the browser. You can turn off this behavior from the Save As dialog.
You can also click on Options at the bottom of the Save As dialog to launch the Publish Settings dialog. Using this dialog, you can select the pages that display and, for data connected diagrams, the data sources that refresh in the browser.
Visio Services allows you to refresh data-driven diagrams in the browser to present the most up-to-date view of the underlying data. The data sources selected in the Publish Settings dialog will be the data sources that refresh. Visio Services supports refreshing the following data sources:
In addition to giving you the option to customize your publish options, the Publish Settings dialog also indicates publishing issues. For example, in the image above, the data source titled “Sales data” has a warning icon beside it. This sales data is stored in a local Excel Workbook: this data source is not supported by Visio Services because it is stored on a local machine. If you want the data from an Excel Workbook to refresh with Visio Services, you should save the workbook to a SharePoint site, link your diagram to the workbook on SharePoint and then save your diagram to the SharePoint site.
On save, Microsoft Visio 2010 generates a Web Drawing file which is in fact a package containing:
Once your Visio Web Drawing file is saved to SharePoint, you can continue to work with it in Visio. Visio Professional 2010 and Visio Premium 2010 both fully support Visio Web Drawing files. This means that you can edit Visio Web Drawing files using the complete set of features provided by Visio.
As you try out Visio Services, please let us know what you think, either by commenting on the blog or via Send a Smile.
The Visio team is pleased to announce that the online version of the Visio 2010 SDK documentation is now available here. This documentation, which also shipped with the Visio SDK download, is intended to help developers working with the Visio APIs, ShapeSheet and XML. It contains the following Visio developer references.
For Visio Services developers, documentation is available online as well as offline via the Microsoft SharePoint 2010 SDK. This documentation is divided into Visio Services in SharePoint Server overview articles and Visio Services Class Library technical information, and covers the following topics.
As always, we enjoy hearing your feedback about Visio, the Visio SDK and our documentation. Please feel free to post any questions or suggestions to our blog.
A new series of training videos have been posted on Office.com to introduce Visio users to Business Process Modeling Notation (BPMN). The videos are packaged as a course named BPMN Diagramming Basics.
The course provides both an introduction to the BPMN notation and a tutorial on creating BPMN diagrams with Visio 2010 Premium. Along the way you can see some of the other new features of Visio 2010 including Swimlanes, AutoConnect, Subprocesses, and Diagram Validation. The complete course takes less than 30 minutes to view.
Please remember that the BPMN, Subprocess, and Diagram Validation features are part of the Premium Edition of Visio 2010.
Be sure to let us know what you think!
In a previous blog post, we explained how Visio 2010 ships with a unique single image architecture. This post explains how to deploy the three different editions of Visio 2010, and how to change the edition of Visio 2010 after you have already deployed it. In particular, the following scenarios are covered:
This post also contains links to more information on Visio 2010 deployment and customizations.
With volume licensing, Visio 2010 can be installed as Visio Standard, Visio Professional, or Visio Premium based on a product key. By default, Visio 2010 uses a Visio Premium 2010 KMS client key, which enables all the features that are available for Visio Premium 2010. If you are licensed to use Visio Standard 2010 or Visio Professional 2010, you must install the appropriate KMS client key. Different features or applications are available, depending on the kind of key that is installed. This makes it easier for you to upgrade or downgrade without having to deploy a different product edition.
For more on this single image architecture, see this blog post: Volume Activation for Visio 2010 Explained.
For more information on Office 2010 deployment in general, see the following resources:
If you’re planning on deploying Visio 2010 to your organization, and want to deploy Visio Standard or Visio Professional, you will need to change the key that Visio 2010 will be deployed with. There are two ways to do this before deployment:
Below are step by step instructions on how to use these two methods. Note that you should only use one of these methods, not both.
Note: this method can be used to install with a key for any edition of Visio, but we’ve chosen Visio Standard for the example.
1. Open up a command prompt and navigate to the directory where the Visio 2010 installation folder is 2. Open the Office Customization Tool (OCT) by calling setup.exe with the /admin switch: 3. Select “Create a new setup customization file for the following product” and choose Visio 2010. This should already be selected by default 4. In the OCT, select “Licensing and user interface” from the menu on the left 5. Select “Enter another product key” 6. Enter the Visio Standard 2010 KMS client key: 7. Click FileàSave and save the MSP somewhere. Choose a name you’ll remember like “VisioStandardKMSKey” 8. Copy this MSP file to the “updates” folder in the Visio 2010 installation folder.
1. Open up a command prompt and navigate to the directory where the Visio 2010 installation folder is
2. Open the Office Customization Tool (OCT) by calling setup.exe with the /admin switch:
3. Select “Create a new setup customization file for the following product” and choose Visio 2010. This should already be selected by default
4. In the OCT, select “Licensing and user interface” from the menu on the left
5. Select “Enter another product key”
6. Enter the Visio Standard 2010 KMS client key:
7. Click FileàSave and save the MSP somewhere. Choose a name you’ll remember like “VisioStandardKMSKey”
8. Copy this MSP file to the “updates” folder in the Visio 2010 installation folder.
Now when you deploy this installation of Visio 2010, it will use the custom MSP file that includes the Visio Standard 2010 KMS client key. This will install Visio 2010 Standard. You can also replace the key in step #6 with a Visio Professional KMS client key or a Multi Activation Key (MAK) for either of the three Visio 2010 editions.
Note: this method can be used to install with a key for any edition of Visio, but we’ve chosen Visio Professional for the example.
1. Navigate to the Visio 2010 installation folder 2. Open the “Visio.WW” folder 3. Open the “config.xml” file with a text editor like Notepad 4. Add the following line to use the Visio Professional 2010 KMS client key: <PIDKEY value="7MCW8-VRQVK-G677T-PDJCM-Q8TCP" /> 5. Save the file
1. Navigate to the Visio 2010 installation folder
2. Open the “Visio.WW” folder
3. Open the “config.xml” file with a text editor like Notepad
4. Add the following line to use the Visio Professional 2010 KMS client key:
<PIDKEY value="7MCW8-VRQVK-G677T-PDJCM-Q8TCP" />
5. Save the file
Now when you deploy this installation of Visio 2010, it will use the Visio Professional 2010 KMS client key specified in config.xml. This will install Visio Professional 2010.
You can also replace the key in step #4 with a Visio Standard KMS client key or a Multi Activation Key (MAK) for either of the three Visio 2010 editions
If you’re planning on deploying multiple editions of Visio, we suggest that you keep three copies of the Visio installation media, and use one of the methods above to customize an installation for each edition you plan on deploying.
The following are the KMS client keys for Visio 2010. These can be used to install Visio 2010, but you will still need a KMS host key with your KMS server to activate Visio installations.
Visio Premium 2010
Visio Professional 2010
Visio Standard 2010
For more on KMS activation, please see the Deploy Volume Activation of Office 2010 article.
If you’ve already deployed Visio 2010 and would like to change the edition that is deployed, you can do so through several ways, none of which require a reinstallation:
1. Use the “Change Product Key” feature on the machine where Visio is installed This can be invoked from Visio 2010’s Backstage View It can also be invoked from Add/Remove Programs à Change 2. Use the Volume Activation Management Tool 2.0 (VAMT) VAMT is a tool administrators can use to manage activations of Office 2010 on managed systems. VAMT can be used to push down a new product key. For more information on how to use VAMT, see the following resources: Download VAMT from here Full TechNet reference on VAMT and how to use it: Managing Activation Using the Volume Activation Management Tool (VAMT) A set of videos on how to use VAMT Deploy Volume Activation of Office 2010 – this article has more information on the methods described in this blog post, as well as how to use VAMT to change keys 3. Use a script that calls ospp.vbs on the machines you would like to change The Office Deployment Support Team blog has a great article and an example script on how to use ospp.vbs with Visio 2010
1. Use the “Change Product Key” feature on the machine where Visio is installed
2. Use the Volume Activation Management Tool 2.0 (VAMT)
3. Use a script that calls ospp.vbs on the machines you would like to change
Note: With any of the methods above, Visio may need to be rebooted up to two times before the user interface and Backstage View update to reflect the new key and edition.
Depending on your User Account Control settings (UAC), in Add/Remove Programs, Visio may still be shown as the previous edition installed.
As always, let us know if you have any feedback on Visio 2010, Visio Services, or suggestions for blog posts you would like to see.
Visio has published the XML Schema Definition (XSD) files for the Microsoft Visio 2010 XML Drawing (.vdx) format. This schema is also known as DatadiagramML. The .XSD files allow developers to better understand the structure of Visio XML documents and design solutions that work with the .VDX file format.
The DatadiagramML Schema for Visio 2010 consists of three .XSD files:
More information about the schema is available in the Visio 2010 XML Schema Reference on MSDN.
Do you work directly with Visio XML files? We’d love to hear about your scenarios in the comments.
Yesterday Microsoft announced the availability of Service Pack 1 for Office 2010 and SharePoint 2010. This wave of releases includes updates to Visio 2010 and the Visio Viewer. Here are the links for downloading:
Visio 2010 SP1
Visio Viewer 2010 SP1
The updates to Visio 2010 include stability, security, and performance improvements. SP1 includes the Cumulative Updates and Public Updates to Visio since RTM a year ago.
There are a couple noteworthy improvements in Visio 2010 SP1:
Thank you for your continued feedback on Visio. If you have additional comments for the product team, please add them below or e-mail us a message.
In a previous blog post, we told you about the new Connectivity APIs in Visio 2010 that make it easier for developers to create and to move across a connected diagram. We’ve shown you how to use some of the new APIs to create new connected shapes (see here); now we’ll examine techniques for traversing connected diagrams. One of the most useful APIs for analyzing a connected diagram is the Shape.ConnectedShapes method, which allows you to get a reference to the shapes connected to a shape.
Let’s take a look at a specific scenario to demonstrate how this method can be used to walk through a connected diagram. Imagine that you have a simple project plan, created using the Basic Flowchart template:
In the shape data, each task in the flowchart includes a start date and an end date by which the task must be completed (shown in the chart below).
“Assess needs for project”
“Is project well-defined?”
“Build a prototype”
Ideally, no task in this project should start before the previous task has been completed. You could select each shape and compare the start and end dates in the Shape Data window, but the process would be very manual and tiresome. You could even use Data Graphics to display the start and end dates next to each shape, but it would still require visually inspecting each pair of connected shapes in the drawing.
With the ConnectedShapes method, however, you can write code that walks through each connected shape in your drawing and examine the shapes connected to it. The method returns an array of the shape IDs of all the shapes connected to a shape, filtered by the type of relationship between the shapes (e.g. is the connector “going out” to the other shape or “coming in” from the other shape?). You can also narrow down the returned IDs further by specifying a shape category as an additional filter.
Here’s some simple VBA that will iterate through each connected shape in a diagram and change the fill color of a connected shape if there is unwanted overlap between its start date and the task “before” it.
Dim vsoPage As Visio.Page Dim shapeList Sub TraverseFlowchart() Dim vsoShape1 As Visio.Shape Dim shapeIDArray() As Integer Dim searching As Boolean Set vsoPage = Application.ActivePage Set vsoShape1 = vsoPage.Shapes("Start/End") Set shapeList = CreateObject(“Scripting.Dictionary”) shapeList.Add vsoShape1.Name, 1 GetConnectedShapes vsoShape1 End Sub Sub GetConnectedShapes(shape As Visio.shape) Dim outgoingShape As Visio.shape Dim shapeIDArray As Variant Dim shapeIDArrayNext As Variant Dim outgoingNodes As Integer Dim node As Integer Dim prevTaskEnd As Date Dim nextTaskStart As Date Dim beenChecked As Boolean prevTaskEnd = shape.Cells("Prop.EndDate").result(visDate) shapeIDArray = shape.ConnectedShapes(visConnectedShapesOutgoingNodes, "") If (UBound(shapeIDArray) >= 0) Then outgoingNodes = UBound(shapeIDArray) For node = 0 To outgoingNodes Set outgoingShape = vsoPage.Shapes(shapeIDArray(node)) nextTaskStart = outgoingShape.Cells("Prop.StartDate").result(visDate) Debug.Print shape.Name & " end: " & prevTaskEnd & "; " & _ outgoingShape.Name & " start: " & nextTaskStart If (nextTaskStart < prevTaskEnd) Then outgoingShape.Cells("FillForegnd").Formula = "RGB(255, 0, 0)" End If shapeIDArrayNext = outgoingShape.ConnectedShapes(visConnectedShapesOutgoingNodes, "") beenChecked = shapeList.Exists(outgoingShape.Name) If ((UBound(shapeIDArrayNext) >= 0) And Not beenChecked) Then shapeList.Add outgoingShape.Name, 1 GetConnectedShapes outgoingShape End If Next node End If End Sub
If we run this code on the project plan shown above, we get a result as shown below. Notice that the two shapes that have start dates that are earlier than the previous tasks’ end dates have a red fill applied to them.
In the code sample, the GetConnectedShapes subroutine uses the ConnectedShapes method on the shape passed in as an argument to get an array of the shape IDs (integers) of the shapes that it connects to. (That is, the shape contains the beginning connection of a connector that points to the shapes referenced by the IDs in the array.) Then the subroutine iterates through each shape referenced by the IDs in the array. Next, the value of the “Prop.StartDate” cell of each attached shape is compared to the “Prop.EndDate” cell of the first shape. If the values overlap, the value of “FillForegnd” cell is changed to red.
This code sample also uses the ConnectedShapes method to traverse the connected diagram in a manner similar to “walking” a tree data structure, starting from a specific shape (the first Start/End shape). After it analyzes a shape and one of its attached shapes, the GetConnectedShapes subroutine checks whether the attached shape has any shapes that it connects out to (making another call to ConnectedShapes). If so, the subroutine makes a recursive call to itself (and thereby halting the execution of the original call), passing in the attached shape as an argument. In practice, it is likely that you will need to use this programming technique in conjunction with the ConnectedShapes method in order to work all the way through each shape in a large connected diagram.
(Also notice that the code sample keeps track of each shape whose outgoing nodes have been checked by adding the shape to a dictionary object before the GetConnectedShapes subroutine is called. This will prevent the code from becoming stuck in an infinite loop if the diagram includes a circular reference.)
Even though we’ve used a project plan scenario as the example in this code sample, there are many other practical applications for this technique. In a related but larger sense, you could incorporate this technique within a custom validation checker to determine whether a connected diagram has been constructed correctly. Also similar to the code sample above, you could use this technique to extract and store data from each shape in a connected diagram. (Extending the project plan example, you could get the duration from each task in the workflow and then create a total of all the resource hours needed for the project.)
In the next blog post, we’ll look at another way that you can use this technique and the Page.SplitConnector method to add new shapes to a connected diagram.
For this blog post, we put together a list of some of our favorite Visio tips & tricks. Learn these to save time and improve the look of your diagrams.
Let’s say you’d like to make a grid of shapes like the following:
To create this, first make a copy of the individual shape (e.g. using Control+Drag):
Then, press Control+Y to repeat that operation:
In a similar manner, you can then copy this row multiple times to create a grid.
To keep multiple shapes aligned on a vertical or horizontal line (which can be challenging particularly when they are far apart), drag a guide from the horizontal or vertical ruler onto the drawing page:
You can then also glue shapes to this guide. More on this feature here.
If a shape is covered by other shapes, as is the case with the yellow square below, it can be hard to find a clickable region to select it:
An easy way to select this shape is to click on the blue shape 3 times, pausing in between so as not to double-click. Visio will cycle through selecting each shape that overlaps at your mouse’s location.
Let’s say you manually changed the path of a connector, but don’t like the result:
You can reset its path by right-clicking the connector and clicking “Reset Connector”:
If you want to label a connector, you can add and move text on it the same way that you add and move text on other shapes:
Let’s say you have two connected shapes:
Sometimes when you reposition those shapes, you may end up with an undesirable jagged connector like this:
This happens because the connector stays fixed to its original connection points on the shapes. To prevent this from happening, Visio has a feature called dynamic glue that lets connectors automatically reroute to the nearest pair of connection points. When creating your connector, drag the connector endpoint not to an individual connection point on the shape, but rather toward the middle of the shape until a red box appears around the entire shape, like this:
The result is a more direct connector when you reposition the connected shapes.
Many people know that you can connect neighboring shapes quickly by clicking on the blue AutoConnect arrows around a shape:
Visio 2010 adds a feature where you can also drag a new connector from an AutoConnect arrow to a shape of your choosing:
In the sequence above, after hovering over the AutoConnect arrow to the right of shape #1, a connector is dragged and connected to the target shape #3. You can read more about this feature in this blog post.
If you need more screen space for your diagram, you can collapse the Shapes Window by toggling the small arrow on the top right of the window, which still lets you drag shapes out:
You can read more about this feature in this blog post.
Some of our favorite keyboard shortcuts are described here.
Those are some of our favorite Visio tips & tricks. If you have one you’d like to share, please leave a comment below.
As mentioned in the last post, Visio 2010 has reached the Release to Manufacturing milestone. The product team has spent the last several months incorporating your feedback from the Beta and refining the product. A large community of customers, partners, and MVPs has contributed to this effort. More than 500,000 people have downloaded the Visio 2010 Beta release, and the feedback has been very positive. People have commented on the blog, sent e-mail, submitted Send-A-Smile reports, logged crash reports, and contacted Product Support to provide feedback on the product.
This post describes some of the more visible changes you will find between Beta and RTM. Overall very little is different in the user interface for RTM. The bulk of the work has been targeted at improving reliability (fixing bugs), performance, and security.
Quite a few people commented on the reduced set of drawing tools on the Home tab as compared with the Drawing Tools toolbar in previous releases. Users of the Beta did not know or did not want to go to the Developer tab for the complete set of tools. You can find all six tools on the Home tab for RTM.
At the bottom of the Fill and Shadow dropdown menus in the Home tab are commands to open a formatting dialog for more properties. A similar command is missing for the Line dropdown menu in the Beta. This command has been added for RTM for better consistency across the formatting features.
There are a number of small changes in the Backstage view to make saving files to SharePoint more understandable. First the name of the tab for publishing and sharing files has changed from “Share” to “Save & Send”. Then in the Save to SharePoint place, the option for selecting whether to publish as a Drawing (*.vsd) or Web Drawing (*.vdw) has changed from “Save Drawing As” to “File Types”. Finally the command button has changed from “Save to SharePoint” to “Save As”. The intent is to use familiar terms to describe the actions for saving a document. Also “Save As” makes it clearer that the command will present the Save As dialog to confirm all the settings before saving.
If you apply formatting to a shape (e.g., fill color or pattern) and then copy it to a different page in a themed document, the formatting will be preserved as long as the theme on the destination page is the same as on the source page.
RibbonX is the extensibility framework for the Office Fluent UI. RibbonX provides customization of the Ribbon, the Backstage view, and context menus. Visio 2010 Beta did not support context menu customization, but support has been added for RTM for most of Visio’s context menus. More information on RibbonX extensibility in Office 2010 is available in this blog post.
These are the more visible changes for Visio 2010 RTM from the Beta. There are many more improvements behind the scenes to make Visio 2010 a fast, secure, and reliable release. Thank you for all the Beta feedback. We hope you will try out the final version of Visio 2010 as it becomes available in the coming weeks. Please continue to let us know what you think or want to hear more about.
Recently Mark Nelson from the Visio team sat down with Harry Miller (off-screen) to discuss some of the improvements in Visio 2010 related to process diagrams. The video includes explanations of our Process Management investments as well as demos for Cross-functional Flowchart, BPMN diagram and Validation features.
The conversation is the latest in a video series titled “Visio: Drawing on Experience” posted on Microsoft TechNet. Other videos featuring some of our Visio MVPs can be found here: http://edge.technet.com/Tags/Visio/
One of the goals of the Visio 2010 release is to make it easier to create attractive, presentation-quality diagrams. Previously on this blog, we have discussed our improvements to backgrounds, layout, routing, and themes. Visio 2010 also features improvements to the default look of many templates, as well as over 500 newly designed shapes. Below are a few highlights of these changes.
Many Visio 2010 templates feature a new, consistent set of default line, font, and shadow properties that help make diagrams look more modern. Here is an example comparing part of a Visio 2007 flowchart with a Visio 2010 flowchart:
In addition to these general enhancements, below are some specific templates we made significant changes to.
The Landmark Shapes stencil in the Directional Map template has around 30 newly designed shapes. Here are a few:
The Workflow Shapes template also has around 30 newly designed shapes. Here are a few:
Here is a calendar created in Visio 2010, with our newly designed calendar and icon shapes:
Visio 2010’s timeline shapes have a sleek new look. Here is an example:
The above are just a few examples. Here is a more comprehensive list of stencils and templates with new or updated shapes:
We are interested in your feedback on these visual updates. You can use the Send a Smile feedback tool or comment on the blog to let us know what you think.
When creating and maintaining flowcharts, a pain point users suffer from is ensuring that the connectors between shapes look good. Visio introduced the dynamic connector many releases ago to help simplify diagram maintenance. Dynamic connectors in combination with dynamic glue allow Visio to choose the sides of shapes to glue your connectors for the best looking results.
In Visio 2010 we made improvements to Visio's routing engine to address some common flowcharting pain points. (For more on the dynamic connector and why you should use dynamic glue, see this previous post titled "Gluing It All Together". )
Improving Flowchart Readability
Clarity is important in flowcharts. Overlapping connectors flowing in opposite directions can create ambiguity about the meaning of the diagram. It is easy to get into a situation where two connectors appear visually to be connected, but were not explicitly connected by the diagram author. Visio 2010's routing engine detects such ambiguous situations and relocates connectors to actively avoid them.
Consider the example below where I draw two dynamic connectors: one from shape A to B and the other from B to C. In Visio 2007, this leads to an ambiguous drawing, where it appears as if shape A is connected to shape C. Visio 2010 moves the connector between A and B to an alternate side of shape B to resolve the ambiguity.
We made this design change based on user feedback. It scales to handle more than just a few connectors, and allows connectors to overlap when they are flowing in the same direction.
A consequence of this change is that if you open a diagram that was created in older versions of Visio in Visio 2010, as you edit your diagram, you may see connectors relocate to different sides of shapes. Note that Visio doesn't move glue points of connectors that are statically glued.
Relaxing Constraints on Flowchart Direction
Visio flowcharts that use the "Flowchart" routing style have a routing direction, like "Top to Bottom" or "Left to Right". In flowchart routing, this controls what sides of shapes dynamic connectors (mostly) connect to. Strict adherence to this direction can easily lead to situations where a dynamic connector takes a path around a shape with 5 segments.
Using "Top to Bottom" as my routing direction, routes generally exit from the bottom of a shape and connect to the top of the shape, except in cases where shapes line up exactly.
In Visio 2010, we enable dynamic connectors to connect to alternate sides of shapes when the shapes are close to each other.
To strike a balance between having simple looking connectors and still adhering to the flowchart direction, Visio connects to non-standard sides of shapes when two shapes are close to each other in the axis of the routing direction.
As always, we're interested in your feedback on routing, so use the Send a Smile feedback tool or comment on this post to let us know what you think.
A recent newsgroup post asks for an explanation of the cells that get added to a shape when it is converted using the Process Engineering add-on.
The Shape Conversion command in Process Engineering allows you to make any shape work like the built-in Process Engineering shapes. We recognized that customers who made Piping & Instrumentation diagrams often had custom equipment or valves or instruments that they needed to include in the diagram. Shape Conversion modifies a custom shape to make it recognizable by the Process Engineering add-on and match the behaviors of built-in shapes.
You can try this by drawing a rectangle and choosing Shape Conversion from the Process Engineering menu. In the dialog, note that the shape Source is already set to Selected Shapes. Process Engineering can also bring in shapes from other documents or CAD symbols. Then comes the challenging part: you can optionally give the shape a Category and Tag Format. Categories are used to organize the shape in the Component Explorer window. You can choose an existing category or type in a new string. Tag formats are used for automatically labeling and numbering shapes. You must choose from an existing tag format. Visio only offers you choices for Categories and Tag Formats that already exist in the drawing, so if you want your shape to be a piece of Equipment you should drop a built-in Equipment shape on the drawing before converting your custom shape.
After clicking OK, you can open the Shapesheet window to see what changes were made to your shape. The primary change is the set of User-defined cells added to the shape. These cells identify the shape and control its behavior in the diagram.
Here is a brief explanation of each cell:
A GUID (unique identifier) that tells Visio what add-on is managing the shape. All shapes that are used with Process Engineering, need the GUID matching the Process Engineering add-on.
The Category that the shape is assigned to. The shape appears under this name in the Component Explorer.
The current tag name (label & number) for the shape.
The Tag Format name and expression for the shape. Unless the Component Tag has been overwritten, this is the automatically generated label displayed on the shape.
The sequence number for the shape. Visio updates this value when components are renumbered. This value then feeds into the Component Tag.
A Boolean value that determines whether the Component Tag is displayed on the shape. This is manipulated by an Action in the Actions section.
A value that references the global page setting for hiding tags. If tags are hidden at the page level, then the local setting is ignored.
This is a bit flag that controls the layout behavior of the components in the diagram. Mostly these settings determine how the split and heal features in Process Engineering work. Here are the bits:
CAUSES SPLIT = 1 (Splits connector when dropped on connector)
CAUSES HEAL = 2 (Heals connector when deleted)
ALLOWS SPLIT = 4 (Connector splits when shape dropped)
ALLOWS HEAL = 8 (Connector heals when shape deleted)
ALLOWS JUNCTION = 16 (Connector to connector connection)
JUNCTION IN USE = 32 (Temporary state)
The default setting here is 31, which enables all the split and heal and junction behaviors.
There are a few other changes to connection points, action cells and text to complete the conversion. These are straightforward changes, and you can inspect the Shapesheet to see the details.
Tuesday more than 300 customers, partners and Visio community members gathered for Day 1 of Visio Conference 2008. Attendees were treated to an impressive array of partner solutions, product demonstrations and information-filled sessions. To top it all off, attendees got the first sneak peak at the next version of Microsoft Office Visio.
At this point Visio "vNext" is still in an early stage (pre-Alpha), but we wanted to give everyone a glimpse of the fantastic capabilities of the next version and outline our high-level investments. Keep in mind that plans can and do change as we respond to feedback and continue working toward completion. We are publicly showing just a few of the features planned. Here are the three areas where we are concentrating most of our efforts:
Visio "vNext" reinvents the core flowcharting experience in Visio. Flowchart creation is faster and easier than ever. Cross-functional flowcharts in particular are improved. Going beyond a simple drawing canvas, Visio understands the logical structure of the diagram far better. This leads to more advanced process diagramming capabilities that put the user firmly in control over the graphical representation of their processes.
Ease of Use
Visio "vNext" adopts the Office Fluent user interface that you see today in Office 2007 core applications. The Ribbon and Live Preview components in particular take the guesswork out of finding Visio commands and choosing between settings. At the same time Visio improves a wide range of existing features, bringing the results-oriented concepts behind the Fluent UI onto the diagramming surface itself. The Shapes window, layout and AutoConnect are significantly enhanced. Visio is even easier to use and significantly reduces the time needed to create and modify diagrams.
Visio "vNext" introduces server-rendered, data-refreshable diagrams for the first time. Visio Services allows data connected diagrams to be published from Visio to a server and viewed by users directly in their web browser. There are no client bits to install. An API is also provided for creating mashups of diagrams and additional data.
There is far more to talk about with Visio "vNext". In future posts we will begin to provide more details and present screen shots. However, there are also plenty of things to discuss about the current Visio 2007 product. We'll cover both in the coming months. Please stay tuned and be sure to give us your feedback.
Every once in a while a new feature idea comes along that is so unique and compelling that it revolutionizes the way people work. Insert Text Box is not such a feature. Adding text to a diagram is nothing new in Visio. However, usability studies have shown that adding text is one of the more challenging tasks for new users. Thus we added Insert Text Box to Visio 2007 to make diagramming a little more approachable.
Insert Text Box is a menu command that invokes Visio's Text tool. Choosing the command is the equivalent of clicking on the Text tool in the Standard toolbar. We found that new users were not aware of the little 'A' toolbar button. In contrast, most users were aware of PowerPoint's Insert Text Box command, and many would look for a similar command in Visio. Now that command exists.
One significant difference between the Insert Text Box command and the Text tool is that you can only insert one text box at a time with the command. Once the text box is created, Visio automatically switches back to the Pointer tool. With the Text tool you remain in text mode until you manually switch back to the Pointer tool. The one-shot method solves another problem for new users - not knowing about the Pointer tool. Even after users discovered the Text tool, they did not always realize that they had to switch back to the Pointer tool at some point.
Microsoft Office Visio 2007 - now with text box insertion technology. Buy it today.
Our MVP community has been quite busy creating new resouces for Visio. We'd like to highlight a few recent releases here.
In response to a newsgroup discussion on Visio's Network Rack shapes. Chris Roth (Visio MVP and former employee) has released a new shape for displaying rack unit dimensions.
Second, the latest version of the Work Breakdown Structure (WBS) Modeler add-in has been released. To quote from the add-in description:
"The Microsoft Office Visio 2007 WBS Modeler is intended to improve the project planning process by giving the opportunity to generate Project Plans from a Work Breakdown Structure (WBS) using a graphical representation of elements.
The Application enables effective integration of Microsoft Office Visio 2007 with Microsoft Office Project 2007. It provides an approach to visually and graphically create, edit and modify project plans using Visio 2007."
Finally, there are new training materials for Visio 2007 solution development. Here is the summary for the download:
"Gain deeper technical skills around Visio 2007 solution development. The Visio 2007 Solution Development Workshop is a free to download, self paced instructional guide covering the concepts and techniques needed to develop Visio based data visualization solutions. The content of this workshop maps to the main themes of the upcoming Visio MCP examination, makes for an excellent readiness resource and provides partners with the skills to start build data Visualization solutions today."
Data Graphics is a great new feature in Visio 2007 Professional for displaying data on your shapes. One key to the feature's popularity is that you can make or customize your own data graphic callout shapes. There is an article posted on MSDN that covers the full spectrum of customizations possible for Data Graphics. Also check out this post that discusses customizing a data graphic callout. In this post we're going to create a text callout from scratch.
A text callout is one of the four ways that you can visualize data using Data Graphics. It performs the basic role of showing data as text labels on the diagram. In the picture above, there are four text callouts to the left of the Server shape and one below the shape. Some callouts display just a value; others include a field label. The formatting and geometry are as customized as you want to make them.
To create a brand new text callout, we need to create a shape with the look we want and then configure it to work with the Data Graphics feature. For this example we'll do just the minimum steps needed to get things working. We draw a rectangle on the page and open its Shapesheet. In the Shapesheet, we need to insert a User-defined section and a Shape Data section.
There are just two things needed to make this shape a data graphic callout. First, change the row name of the User-defined row to User.msvCalloutType (click on the row name and type "msvCalloutType"). In the Value cell enter "Text Callout" - including the quotation marks here. Second, change the row name of the Shape Data row to Prop.msvCalloutField (click on the row name and type "msvCalloutField").
Visio uses the User.msvCalloutType value to determine where to surface your custom callout shape in the Data Graphics user interface. This shape will appear in the Callouts list in the New Text / Edit Text dialog. Visio populates the Prop.msvCalloutField value (the Value cell in this row) with the data to display at the time the data graphic is applied to a shape on the page. To make it easier to continue building the shape, you may want to put some text in the Value cell to serve as sample data.
What's missing from this shape is the actual display of the data as text. This is typically done using Text Fields. With the shape selected in the drawing window, go to Insert > Field and choose the msvCalloutField in the Shape Data category.
Now we can test this shape. Drag it into the Document Stencil to create a Visio Master shape. Give the master a name.
Now drop a shape on the page and give it some data. The Basic Flowchart Shapes are a good test bed since they have three built-in Shape Data fields. You can right click on the flowchart shape and choose Data > Shape Data to fill in some values. Now right click again and choose Data > Edit Data Graphic to create a new data graphic with your callout.
Because we set the User.msvCalloutType to "Text Callout", we need to go to New Item > Text. In the New Text dialog open the Callout dropdown to see the custom callout shape we made.
Choose the custom callout and then a Data field to display in the callout. Finally click OK twice to see the callout applied to the flowchart shape as a data graphic.
Go ahead and change the Shape Data in the flowchart shape to see it update in the data graphic. Now we have a functioning text callout. What remains is whatever customizations you want to make to enhance the visual appearance of the callout. Perhaps you want to apply formatting or tailor the geometry. Perhaps you want to add configurable settings that the user can select in the New Text / Edit Text dialog. See the MSDN article for more information about adding this functionality. As always, you can look at the callouts that are built into the Data Graphics feature for examples of more sophisticated behaviors.
If you have some suggestions for new data graphic callouts, post a comment. We'd like to hear from you. In the next post we will look at an example for Data Bar callouts.
This is the second post in a series demonstrating how you can create data graphic callout shapes for use in Visio 2007 Professional. The first post discussed Text Callouts. There is also an article on MSDN that covers the full spectrum of customization possibilities for Data Graphics.
A Data Bar is one of the four ways you can visualize data using Data Graphics. It displays numeric data in a graphical form using the geometry of the callout shape to indicate the magnitude of the data value. Data Bars may also display text and can even display multiple fields at once. As with the other Data Graphics callouts, the visualization is as customized as you want to make it.
In this post we are going to create the “slider” shape shown above. This callout has two parts. A long, thin bar shows the full range of possible data values, and a circle slides along the bar to indicate the current data value. The circle also displays the current data value as text expressed as a percentage. Let’s start with the bar and perform the minimum tasks necessary to create a Data Graphic callout.
We draw a rectangle on the page and open its Shapesheet. In the Shapesheet, we need to insert a User-defined section and a Shape Data section. To make this shape a Data Graphic callout, first change the row name of the User-defined row to User.msvCalloutType (click on the row name and type "msvCalloutType"). In the Value cell enter "Data Bar" - including the quotation marks here. Next change the row name of the Shape Data row to Prop.msvCalloutField (click on the row name and type "msvCalloutField"). Data Bars also have Shape Data rows for the minimum and maximum values that the callout field can have. Add two more Shape Data rows named Prop.msvCalloutPropMin and Prop.msvCalloutPropMax. Enter labels in the Label column and the word “Number” in the Prompt column as shown in the screenshot.
Visio uses the User.msvCalloutType value to determine where to surface your custom callout shape in the Data Graphics user interface. This shape will appear in the Callouts list in the New Data Bar / Edit Data Bar dialog. Visio populates the Prop.msvCalloutField value (the Value cell in this row) with the data to display at the time the data graphic is applied to a shape on the page. Visio also will fill in values for Min and Max based on the data recordset, and these are exposed in the Data Bar dialog as well. This shape will now be treated as a Data Graphic callout if you drag it into the Document Stencil, but right now it doesn’t do anything with the data from Visio. We need to build out the rest of the shape to make it work like a data bar.
Our rectangle will serve as the long, skinny part of the data bar - indicating the full range of field values. It also is responsible for displaying the field label. We want this label to be optionally hidden as is the case in the sample callout above. Visio will place the field label in the Prop.msvCalloutField.SortKey cell (a strange place, yes, but the Label cell is already used for exposing properties in the Data Bar dialog). Enter some default text such as “Label” (including quotation marks) in this cell. Then select the rectangle in the drawing window and choose Insert > Field. Choose Custom Formula and then enter the formula: “=Prop.msvCalloutField.SortKey” (no quotation marks) and press OK. We want the label to be outside the rectangle on the right side. In the Shapesheet insert a Text Transform section and fill it out as shown below:
We want the user to be able to choose whether the field label is shown or hidden. Data Graphics allows us to create our own callout property to display in the Data Bar dialog. Add a new Shape Data row and name it Prop.msvCalloutPropShowLabel. The row name must include the prefix “msvCalloutProp” to be recognized as a callout property. Then place a human-readable name in the Label column and the word “Bool” in the Prompt column. The Label value appears in the dialog as the name of the property. The Prompt value tells Data Graphics what type of control to use in the dialog – in this case a simple True / False dropdown. Visio will put the user’s choice in the Value cell. Go ahead and enter the default value True here. A full explanation of the syntax for custom callout properties is included in the MSDN article. Finally tie the visibility of the shape’s text to this Value cell by entering this formula in the HideText cell: “=NOT(Prop.msvCalloutPropShowLabel)”.
Data bar value
Next we will create the circle shape that represents the current value for the data bar. The rectangle and circle together form the callout shape, so we need to make a group. Select the rectangle shape and choose Shape > Grouping > Convert to Group to make this the top-level group shape. In the rectangle’s Shapesheet set the LockCalcWH cell to 1 so that further grouping operations do not change the shape’s size. Also set the DisplayMode cell to 1 so that the rectangle will appear behind its subshapes. Now draw a circle on the page. Select the rectangle, then Ctrl-click on the circle to select it as well. Choose Shape > Grouping > Add to Group to make the circle a subshape of the rectangle.
The position of the circle is dependent on the current field value and its relative size versus the Min and Max values. We’ll add a User-defined cell to the rectangle shape to calculate the percentage of the total range. In the rectangle’s Shapesheet add a User-defined row named User.PercentFilled and enter this formula:
This expression calculates the current percentage of the field value between Min and Max. It also prevents division by zero and checks to make sure that the result stays between 0 and 1 so that our data bar behaves predictably.
The User.PercentFilled value will be used by the circle subshape to control its position and to display the value as text. We’ll start with the value display. In the circle’s Shapesheet insert a User-defined section and add a User.PercentFilled row that references the value from the rectangle. Since we will use this value multiple times, it is good practice to use a single cross-sheet reference and then multiple local cell references. (Note that your sheet ID’s may be different than those shown here.)
Now select the circle in the drawing window and choose Insert > Field. Choose User-defined Cells and select the PercentFilled cell. Before closing the dialog click on the Data Format button. Choose Percentage and 0 decimal places. Then click OK twice. Next we want to tie the size of the circle to the size of the text so that the text always fits. Add another User-defined row named User.CircleDiameter to track the size of the circle. Then add this expression for the value: “=CEILING(TEXTWIDTH(TheText),2 pt)” (omit quotation marks). This expression calculates the current width of the text and rounds it up to the nearest 2 pt to get rid of tiny variations in text width based on proportional character spacing. We add formulas to the Width and Height cells of the circle to tie its size to User.CircleDiameter. The formulas are GUARDed to prevent accidental resizes by the user. Set the NoObjHandles cell to 1 to hide the resize handles since they are not needed.
We’re ready to tie the position of the circle to User.PercentFilled. The circle should move from one end of the rectangle to the other. We must account for the circle diameter when calculating the range of movement so that the circle does not move overlap the ends of the rectangle. Add this formula to the PinX cell:
Also set the PinY cell: “GUARD(Sheet.1!Height*0.5)”.
Our callout is now functional enough to test. Open the rectangle’s Shapesheet and enter sample values for Prop.msvCalloutField as well as the Min and Max properties. You should see the circle move and display the proper value as text. The only remaining work is to enhance the appearance of the data bar. The rectangle height should be a fraction of the circle diameter. Actually, the height of the rectangle shape should encompass both the rectangle and the circle, so we’ll just make the geometry of the rectangle shape smaller. Add a User-defined row named User.CircleDiameter to the rectangle and reference the circle’s User.CircleDiameter cell. Then add a User-defined row named User.BarHeight and set it to be a fraction of the circle size. The geometry of the rectangle is then modified to depend on User.BarHeight as shown in the screenshot below.
The overall size of the callout should be fixed; the width is set to a constant value and the height is large enough to hold the circle. Enter the formulas for Width and Height as shown in the image below. Note that DropOnPageScale is a factor that adjusts the size in cases where a scale other than 1:1 is used in the drawing. This is a good practice whenever hard-coding measurement values like the ones in these formulas.
One final change is to set the LockFromGroupFormat cell to 1. This prevents formatting changes applied to the main shape from propagating to the callout. Generally we want the callout to retain its own formatting unless the user directly selects the shape and modifies it. Our callout shape is complete. The rest of the look is achieved through Themes. Apply a color theme and effects theme to the page. Our sample uses the “Office” color theme and “Button” effects theme, but the callout will pick up whatever theme is applied in your document. Sub-select the circle shape and change the fill color to make it stand out from the rectangle. Accent 2 is a good choice here. The finished shape is below.
Testing the callout
To use this callout, we need to make it a master shape in the Document Stencil. Go to File > Shapes > Show Document Stencil and then drag the shape in. Rename the master to “Slider”. Now we need to apply it to a shape. Draw a text box on the page and type some text. Then right-click on the shape and choose Data > Shape Data. Answer Yes to define new shape data. Add a Label, set the Type to Number and enter a sample Value before clicking OK. Click OK once more to finish adding data to the text shape.
Right-click the shape again and choose Data > Edit Data Graphic. Choose New Item > Data Bar to open the New Data Bar dialog. Choose “Rating” for the data field and make sure that our Slider master is selected as the callout. Then turn off the label by setting Show Label to No. Click OK twice to apply the data graphic.
The final result is shown below.
As you can see there are quite a few steps. However, most of the work is creating the custom behavior and appearance you want. The end result is quite professional and easily integrates into the Data Graphics feature. In the next post we will create the final type of callout used in Data Graphics: the Icon Set.
Visio users and developers often wonder how to distribute their newly created Visio shapes to their colleagues, friends and family (all depends on your friends and family I guess J). Visio offers two mechanisms to publish content, each suited to different situations. This blog entry covers both. But first, an introduction for those new to content creation.
In the Visio world, content refers to shapes, stencils and templates; if you’re familiar with these concepts, please skip to the next section, if not please read on.
· Master shapes are the basic unit of content; they are Visio entities that you can assemble on a drawing page that graphically represent a real-world object or concept. Visio provides a rich set of pre-made master shapes and also enables the creation of custom shapes. To get started authoring shapes, read through this Visio Insights blog posting as well as this set of documents from Microsoft Office Online.
· Stencils are collections of related master shapes that are presented together in the UI. Again Visio provides a large set of pre-made stencils and lets you create your own stencils containing custom made and/or pre-built Visio shapes by following the steps outlined here. Stencils files have a “.VSS” or “.VSX” extension.
· Templates are Visio files that set up the Visio workspace for a particular drawing type by opening appropriate stencils, opening anchored windows and setting page properties such as scale and grid. For example the Space Plan template that ships with Visio opens four stencils, changes paper size and scaling. Instructions on how to create templates may be found here. Template files have a “.VST” or “.VTX” extension.
Publishing a piece of content to Visio adds entry points to the user interface side-by-side with content created by Microsoft. For a stencil this translates into a menu entry added to the File > Shapes fly-out menu while for a template this means an entry in Visio’s startup screen (as seen below) and in the File > New fly-out menu. In this blog entry we will focus on publishing templates to Visio; publishing stencils is quite similar.
The simplest way to publish a template to Visio is to use the Path Discovery method described below:
1. Copy your template and supporting stencils to a known location on a drive.
2. Add the location defined in step 1 to Visio’s “Template Paths”; this tells Visio where to find extra content to populate its startup screen. This can be done manually by following the steps here or may be automated using code that sets the TemplatePaths property on the Visio Application object.
3. Restart Visio – your template should appear in the (Other) category.
The advantages of this approach are:
· It is simple.
· It is supported across most versions of Visio.
It however has a few drawbacks:
· Your users may be subjected to potentially long and error prone manual work.
· Your templates will always end up in the (Other) content category in the startup screen.
· You don’t have any way of repairing content on a user’s machine if it gets damaged.
· You cannot control which language of Visio will load your stencils and templates.
· This approach does not scale well. The Path Discovery publishing method does just that: every time you boot Visio it searches a user’s hard drive for content files – an expensive operation.
Sharing templates through Path Discovery is good for small scale content deployments as well as deployments to older versions of Visio.
The PublishComponent system introduced in Visio 2003 lets developers use Windows Installer technology for template distribution to register their content with Visio in a richer and more robust way. The main advantages of this method are quite interesting:
· The Windows Installer setup wizard is familiar to users and easy to use.
· You may choose where your content appears in the File > Shapes or startup screen hierarchies.
· You benefit from Windows Installer repair, install-on-demand and add/remove features.
· You may choose what language versions of Visio to publish your content to.
· The approach scales well: Visio only rebuilds its content cache, a moderately expensive operation, when new content is published.
· The approach is tried and tested since the product publishes its own content this way since the 2003 release.
That said, using the Publish Component system is:
· A little more complicated than the Path Discovery method.
· Will only work for Visio 2003 and or later.
To use this method you’ll need Visual Studio .NET or later, the Visio 2003 SDK (or the Visio 2007 Beta SDK) and the following steps:
If you installed the package as it is; Visio would not discover the files the MSI installed. To notify Visio on the whereabouts of these files, the next thing to do is populate the PublishComponent table of the MSI produced above with registration data. Once installed, this extra information will force Visio to rebuild its content cache and incorporate and display the new templates and stencils.
The extra information you need to add may be found here. Be warned however, it is not for the faint of heart to enter this data manually. For those of us who would rather not spend their Saturday night writing MSI tables entries you can follow the steps below using the PublishComponent tool shipped in SDK to populate the appropriate MSI table easily:
To make the changes described above double click on each entry to bring up the “Template Information” dialog seen below, or its counterpart the “Stencil Information” dialog.
The MSI can now be distributed; Windows Installer and Visio will do the rest. Although we haven’t discussed it here, the same techniques can be used to publish add-ins and help files. For the curious, use ORCA and the guidance in the KB article above to understand what modifications the tool made to the MSI.
As a final note, you’ll see that the template you just published shows up in the startup screen, however the template preview is blank; I’ll leave it up to crafty souls out there to figure out how to get template preview’s this working… OR you could stay tuned to the Visio Insights blog for more info =).
This post will be a little experiment to try out file attachments on the blog.
When customers send files to us, we often want to get a general understanding about the drawing contents. This is common in scenarios where customers are concerned about performance or file size. Visio drawings may be carrying some excess baggage along.
In addition to shapes on the page, a Visio document contains information about master shapes, styles, layers, fonts, colors, data and other items. These collections of information are used to accurately present the shapes on the page. However, they do not automatically get purged when shapes are deleted from the diagram.
Take the simple example of a flowchart. If you drag a Process shape onto the drawing page, Visio adds a copy of the Process master shape to the document and places an instance of this master shape on the page. If you delete the Process shape from the page, the master shape remains. Over time unused master shapes pile up. Normally this is no big deal, but some shapes contain large bitmaps or other complex information that will quickly increase file size.
Before you go out and delete every master shape from your document, keep in mind that master shapes are highly efficient when they are actually used in the drawing. If you took a drawing with many copies of the same shapes and then deleted the master, you would find the resulting document much larger and slower.
The attached DrawingAnalyzer.vsd document is a handy little tool written in VBA for counting the shapes in a drawing and determining whether there are unused master shapes. Also the tool counts shapes on the page with no master shape, and it keeps track of the level of grouping among shapes. More nested groups mean much slower performance.
To use the tool, open the file in Visio along with any other document you want to analyze. Make sure the document to be analyzed is in the active window. Then go to Tools > Macro > DrawingAnalyzer > ThisDocument > GetDrawingStats. Then open the VBA Editor (Alt+F11) and look in the Immediate Window (Ctrl+G) at the output. Here's a sample result:
Total Pages: 3 Total Shapes: 495
Top Level Shapes: 11 Group Shapes: 92 Max Nesting Depth: 3 Total Masters: 13 Unused Masters: 0 Shapes w/o Masters: 36 Total Patterns: 0 Unused Patterns: 0 Total Styles: 9
A top level shape is a shape directly on the page. All other shapes are found inside of groups. In this example, there are only 11 shapes spread across the 3 pages in the drawing. However, the total number of shapes is 495, meaning there are lots of shapes inside groups. There are even groups inside groups inside groups as evidenced by the maximum nesting depth of 3. This is not terribly efficient. All 13 master shapes in the document are used in the drawing, so that is good. 36 shapes have no master. If any of these shapes are similar, it would be more efficient to create a master shape for them.
The DrawingAnalyzer.vsd file is saved in Visio 2000/2002 format. Please post a comment if you have difficulties getting the file. As we said, this is a test.