What's new for Visio 2013 developers

This document provides a top-level view of the enhancements and additions for developers in Visio 2013. For developers who are ready to get a jump start on the Visio platform, it provides you with sufficient detail to begin coding against Visio 2013.

Visio 2013 provides a powerful single platform for your custom drawing solutions. New objects, collections, properties, methods, enumerations, and events, along with new ShapeSheet cells and functions, give you more options for defining the behavior of the elements in your solutions.

Among the new features of interest to developers in Visio 2013 are the new file format; robust updates to themes; change shape feature (allowing you to replace shapes with another); new shape effects; improvements to commenting; coauthoring on SharePoint Server 2013; customizable image clipping; relative geometry; support for Business Connectivity Services (BCS) data; updates to Visio Services in Microsoft SharePoint Server 2013; and a duplicate page feature. This topic gives a brief summary of each of these features and mentions some of the new Visio objects and members that are associated with the features and exposed in Visual Basic for Applications (VBA). For information about these features and accompanying code samples, see the Visio Developer Center.

Note Note

Visio 2013 includes many new ShapeSheet cells, rows, and functions to support the new features in Visio. For more information about what’s new in the ShapeSheet for Visio 2013, see the article What's new for ShapeSheet developers in Visio 2013.

Visio 2013 introduces a new file format, based on the Open Packaging Conventions (OPC) standard (ISO 29500, Part 2) and the XML elements from the previous Visio XML file format (.vdx). It is a zipped, XML-based file format similar to the file formats used in other applications.

Because the new file format is supported by both Visio 2013 and Visio Services in Microsoft SharePoint Server 2013, you can save a Visio drawing directly to an SharePoint Server library, without having to publish the file as a Visio Web Drawing (.vdw). Even so, Visio Services can still read and display Visio Web Drawing files.

The new file format includes the following file types (by extension):

  • .vsdx (Visio drawing)

  • .vsdm (Visio macro-enabled drawing)

  • .vssx (Visio stencil)

  • .vssm (Visio macro-enabled stencil)

  • .vstx (Visio template)

  • .vstm (Visio macro-enabled template)

By using existing support for reading and writing to the file format package (such as System.IO.Packaging) and for parsing XML (System.Xml.Linq), you can programmatically work with the new file formats.

Visio 2013 retains the ability to read the old file formats (.vsd, .vss, .vst, .vdx, .vsx, .vtx, .vdw, .vwi). Visio 2013 does not save to the previous Visio XML file format (.vdx). Solutions or tools that consume the previous Visio XML file format (.vdx) files may need to be refactored in order to read the new file format and its schemas.

Visio Services retains the ability to display the Visio Web Drawing (.vdw) format in the browser. It now also renders the new Visio drawing (.vsdx) and Visio macro-enabled drawing (.vsdm) formats.

Themes have been redesigned in Visio 2013, making use of a greater variety of effects and styles including the integration of Shape Art effects. Users can now decide on an overarching style by applying a theme, personalize the diagram with theme variants, and highlight individual shapes with Quick Styles. ShapeSheet developers can take advantage of these features with new functions and cells in the ShapeSheet.

You can also manipulate themes at the Page, Shape, and Selection object level. New APIs for working with themes include Page.SetTheme method, Page.SetThemeVariant method, Shape.SetQuickStyle method, and the Selection.SetQuickStyle method.

For a detailed list of the new APIs in Visio 2013, see the Visio object model changes section in this article. For more information about the new ShapeSheet cells in Visio 2013, see the article What's new for ShapeSheet developers in Visio 2013.

Visio 2013 includes a shape replacement API that enables you to swap one or more shapes for another shape contained in a stencil, while retaining some of the local values from the original shape, like the shape text shape, shape data, or shape formatting. Shape developers can update the ShapeSheet settings of their custom shapes to specify the Change Shape behavior for their shapes. Among the new APIs are the Shape.ReplaceShapes and Selection.ReplaceShapes methods and the ReplaceShape event.

For a detailed list of the new APIs in Visio 2013, see the Visio object model changes section in this article. For more information about the new ShapeSheet cells in Visio 2013, see the article What's new for ShapeSheet developers in Visio 2013.

New shape effects such as bevel, 3-D rotation, glow, reflection, and sketching have been added to Visio 2013. The ShapeSheet includes new cells for working with these affects.

For more information about the new ShapeSheet cells in Visio 2013, see the article What's new for ShapeSheet developers in Visio 2013.

Visio 2013 includes a new commenting framework. Comments can now be associated with a particular shape or page. Visio 2013 includes two new objects, Comments and Comment. New APIs for accessing comments programmatically include the Document.Comments, Page.Comments, Shape.Comments, and Page.ShapeComments properties.

Visio Services includes JavaScript APIs to read the comments from a page or shape in a diagram.

For a detailed list of the new APIs in Visio 2013, see the Visio object model changes section in this article.

Note Note

Comments are no longer accessible through the ShapeSheet.

Visio 2013 includes the ability to co-author diagrams stored on SharePoint or Microsoft OneDrive. Developers have access to the Document.AfterDocumentMerge event which provides information about diagram changes due to coauthoring. Solution developers also have the ability to disable coauthoring to suit their custom needs using the NoCoauth cell on the Document ShapeSheet.

For a detailed list of the new APIs in Visio 2013, see the Visio object model changes section in this article.

Visio 2013 supports defining a Custom Image Clipping path to crop images to any shape. This extends the capacities of Visio 2010, which supported clipping images in a rectangular way. This functionality is available in the ShapeSheet by using the ClippingPath cell in the Foreign Image Info section.

For more information about the new ShapeSheet cells in Visio 2013, see the article What's new for ShapeSheet developers in Visio 2013.

In previous versions of Visio, shape geometry was defined by formulas that depended on the height or width of the shape. For example, in Visio 2010 the vertices of many built-in Visio shapes were defined by multiplying the height or width of the shape by a constant. These shapes had Geometry sections that included MoveTo or LineTo rows (for example) with formulas like Width*1 and Height*0.

Visio 2013 now supports relative geometry in the ShapeSheet. Shape developers can now use relative geometries to specify geometries as simple values or formulas, which multiply by the height or width automatically. Shape vertices can now be expressed with constants, for instance, removing the need to express vertices as multiples of the shape width or height. This makes it easier for developers to create shapes, with better performance and smaller file sizes. New rows include the RelMoveTo and RelLineTo rows where the X and Y cell values are automatically multiplied by the width or height of the shape (respectively).

For more information about the new ShapeSheet rows in Visio 2013, see the article What's new for ShapeSheet developers in Visio 2013.

Visio 2013 diagrams can now be connected to external lists on SharePoint Server 2013 servers. An external list is a content source external to SharePoint (for example, a SQL Server table) that has been connected to a SharePoint list by using Microsoft Business Connectivity Services (BCS). Visio Services supports the ability to refresh the Visio diagrams as the data updates.

For more information about what’s new in Visio Services, see the article Visio Services in SharePoint 2013. For more information about Business Connectivity Services (BCS), see Business Connectivity Services in SharePoint 2013.

Visio Services in Microsoft SharePoint Server 2013 includes many improvements. As mentioned previously, Visio Services supports the new Visio file format (both .vsdx and .vsdm). Visio Services has expanded data refresh and recalculation, including the ability to recalculate formulas across an entire diagram.

For more information about what’s new in Visio Services, see the article Visio Services in SharePoint 2013.

You can now copy a page and all of its shapes within the same document in Visio 2013. Accordingly, the Page object has a new method, Duplicate, which duplicates the page and returns a new Page object.

New objects, properties, methods, and events have been added to the Visio object model to provide programmability support for new Visio 2013 features. Additionally, object model improvements address frequent developer requests for changes to the Visio platform.

New members

The following members have been added to existing objects in the Visio object model.

Table 1. Visio object model enhancements

Object or collection

New members

Application Object (Visio)

Application.AfterReplaceShapes Event (Visio)

Application.BeforeReplaceShapes Event (Visio)

Application.QueryCancelReplaceShapes Event (Visio)

Application.ReplaceShapesCanceled Event (Visio)

ApplicationSettings Object (Visio)

ApplicationSettings.EnterCommitsText Property (Visio)

ApplicationSettings.SVGExportFormat Property (Visio)

Document Object (Visio)

Document.AfterDocumentMerge Event (Visio)

Document.Comments Property (Visio)

Document.CompatibilityMode Property (Visio)

Documents Object (Visio)

Documents.AfterDocumentMerge Event (Visio)

Documents.AfterReplaceShapes Event (Visio)

Documents.BeforeReplaceShapes Event (Visio)

Documents.QueryCancelReplaceShapes Event (Visio)

Documents.ReplaceShapesCanceled Event (Visio)

InvisibleApp Object (Visio)

InvisibleApp.AfterReplaceShapes Event (Visio)

InvisibleApp.BeforeReplaceShapes Event (Visio)

InvisibleApp.QueryCancelReplaceShapes Event (Visio)

InvisibleApp.ReplaceShapesCanceled Event (Visio)

Page Object (Visio)

Page.AfterReplaceShapes Event (Visio)

Page.BeforeReplaceShapes Event (Visio)

Page.Comments Property (Visio)

Page.Duplicate Method (Visio)

Page.GetTheme Method (Visio)

Page.GetThemeVariant Method (Visio)

Page.QueryCancelReplaceShapes Event (Visio)

Page.ReplaceShapesCanceled Event (Visio)

Page.SetTheme Method (Visio)

Page.SetThemeVariant Method (Visio)

Page.ShapeComments Property (Visio)

Pages Object (Visio)

Pages.AfterReplaceShapes Event (Visio)

Pages.BeforeReplaceShapes Event (Visio)

Pages.QueryCancelReplaceShapes Event (Visio)

Pages.ReplaceShapesCanceled Event (Visio)

Selection Object (Visio)

Selection.ReplaceShape Method (Visio)

Selection.SetQuickStyle Method (Visio)

Shape Object (Visio)

Shape.ChangePicture Method (Visio)

Shape.Comments Property (Visio)

Shape.ReplaceShape Method (Visio)

Shape.SetQuickStyle Method (Visio)

New objects and enumerations

The following objects have been added to the Visio object model.

Table 2. Visio object model additions

The following table lists the new enumerations and constants introduced in Visio 2013.

Table 3. Visio enumeration additions

Enumeration

Description

VisQuickStyleColors Enumeration (Visio)

Specifies designated names for colors contained within a theme.

VisQuickStyleMatrixIndices Enumeration (Visio)

Specifies designated names for the themes and variations provided with Visio 2013.

VisReplaceFlags Enumeration (Visio)

Specifies behaviors for a Change Shape operation.

VisSVGExportFormat Enumeration (Visio)

Specifies the inclusion or exclusion of Visio markup when exporting a diagram to SVG.

Deprecated objects and members

The following table lists the deprecated objects and members introduced in Visio 2013. Only deprecated object members are listed in the Deprecated members column.

Table 4. Visio object model deprecations

Object or collection

Deprecated members

Window object

PageTabWidth property

Community Additions

ADD
Show:
© 2014 Microsoft