visio package

Classes

Visio.Application

Represents the Application.

[ API set: 1.1 ]

Visio.Comment

Represents the Comment.

[ API set: 1.1 ]

Visio.CommentCollection

Represents the CommentCollection for a given Shape.

[ API set: 1.1 ]

Visio.Document

Represents the Document class.

[ API set: 1.1 ]

Visio.DocumentView

Represents the DocumentView class.

[ API set: 1.1 ]

Visio.Hyperlink

Represents the Hyperlink.

[ API set: 1.1 ]

Visio.HyperlinkCollection

Represents the Hyperlink Collection.

[ API set: 1.1 ]

Visio.Page

Represents the Page class.

[ API set: 1.1 ]

Visio.PageCollection

Represents a collection of Page objects that are part of the document.

[ API set: 1.1 ]

Visio.PageView

Represents the PageView class.

[ API set: 1.1 ]

Visio.RequestContext

The RequestContext object facilitates requests to the Visio application. Since the Office add-in and the Visio application run in two different processes, the request context is required to get access to the Visio object model from the add-in.

Visio.Selection

Represents the Selection in the page.

[ API set: 1.1 ]

Visio.Shape

Represents the Shape class.

[ API set: 1.1 ]

Visio.ShapeCollection

Represents the Shape Collection.

[ API set: 1.1 ]

Visio.ShapeDataItem

Represents the ShapeDataItem.

[ API set: 1.1 ]

Visio.ShapeDataItemCollection

Represents the ShapeDataItemCollection for a given Shape.

[ API set: 1.1 ]

Visio.ShapeView

Represents the ShapeView class.

[ API set: 1.1 ]

Interfaces

Visio.BoundingBox

Represents the BoundingBox of the shape.

[ API set: 1.1 ]

Visio.DataRefreshCompleteEventArgs

Provides information about the document that raised the DataRefreshComplete event.

[ API set: 1.1 ]

Visio.DocumentLoadCompleteEventArgs

Provides information about the success or failure of the DocumentLoadComplete event.

[ API set: 1.1 ]

Visio.Highlight

Represents the highlight data added to the shape.

[ API set: 1.1 ]

Visio.Interfaces.ApplicationData

An interface describing the data returned by calling "application.toJSON()".

Visio.Interfaces.ApplicationLoadOptions

Represents the Application.

[ API set: 1.1 ]

Visio.Interfaces.ApplicationUpdateData

An interface for updating data on the Application object, for use in "application.set({ ... })".

Visio.Interfaces.CollectionLoadOptions

Provides ways to load properties of only a subset of members of a collection.

Visio.Interfaces.CommentCollectionData

An interface describing the data returned by calling "commentCollection.toJSON()".

Visio.Interfaces.CommentCollectionLoadOptions

Represents the CommentCollection for a given Shape.

[ API set: 1.1 ]

Visio.Interfaces.CommentCollectionUpdateData

An interface for updating data on the CommentCollection object, for use in "commentCollection.set({ ... })".

Visio.Interfaces.CommentData

An interface describing the data returned by calling "comment.toJSON()".

Visio.Interfaces.CommentLoadOptions

Represents the Comment.

[ API set: 1.1 ]

Visio.Interfaces.CommentUpdateData

An interface for updating data on the Comment object, for use in "comment.set({ ... })".

Visio.Interfaces.DocumentData

An interface describing the data returned by calling "document.toJSON()".

Visio.Interfaces.DocumentLoadOptions

Represents the Document class.

[ API set: 1.1 ]

Visio.Interfaces.DocumentUpdateData

An interface for updating data on the Document object, for use in "document.set({ ... })".

Visio.Interfaces.DocumentViewData

An interface describing the data returned by calling "documentView.toJSON()".

Visio.Interfaces.DocumentViewLoadOptions

Represents the DocumentView class.

[ API set: 1.1 ]

Visio.Interfaces.DocumentViewUpdateData

An interface for updating data on the DocumentView object, for use in "documentView.set({ ... })".

Visio.Interfaces.HyperlinkCollectionData

An interface describing the data returned by calling "hyperlinkCollection.toJSON()".

Visio.Interfaces.HyperlinkCollectionLoadOptions

Represents the Hyperlink Collection.

[ API set: 1.1 ]

Visio.Interfaces.HyperlinkCollectionUpdateData

An interface for updating data on the HyperlinkCollection object, for use in "hyperlinkCollection.set({ ... })".

Visio.Interfaces.HyperlinkData

An interface describing the data returned by calling "hyperlink.toJSON()".

Visio.Interfaces.HyperlinkLoadOptions

Represents the Hyperlink.

[ API set: 1.1 ]

Visio.Interfaces.PageCollectionData

An interface describing the data returned by calling "pageCollection.toJSON()".

Visio.Interfaces.PageCollectionLoadOptions

Represents a collection of Page objects that are part of the document.

[ API set: 1.1 ]

Visio.Interfaces.PageCollectionUpdateData

An interface for updating data on the PageCollection object, for use in "pageCollection.set({ ... })".

Visio.Interfaces.PageData

An interface describing the data returned by calling "page.toJSON()".

Visio.Interfaces.PageLoadOptions

Represents the Page class.

[ API set: 1.1 ]

Visio.Interfaces.PageUpdateData

An interface for updating data on the Page object, for use in "page.set({ ... })".

Visio.Interfaces.PageViewData

An interface describing the data returned by calling "pageView.toJSON()".

Visio.Interfaces.PageViewLoadOptions

Represents the PageView class.

[ API set: 1.1 ]

Visio.Interfaces.PageViewUpdateData

An interface for updating data on the PageView object, for use in "pageView.set({ ... })".

Visio.Interfaces.SelectionData

An interface describing the data returned by calling "selection.toJSON()".

Visio.Interfaces.ShapeCollectionData

An interface describing the data returned by calling "shapeCollection.toJSON()".

Visio.Interfaces.ShapeCollectionLoadOptions

Represents the Shape Collection.

[ API set: 1.1 ]

Visio.Interfaces.ShapeCollectionUpdateData

An interface for updating data on the ShapeCollection object, for use in "shapeCollection.set({ ... })".

Visio.Interfaces.ShapeData

An interface describing the data returned by calling "shape.toJSON()".

Visio.Interfaces.ShapeDataItemCollectionData

An interface describing the data returned by calling "shapeDataItemCollection.toJSON()".

Visio.Interfaces.ShapeDataItemCollectionLoadOptions

Represents the ShapeDataItemCollection for a given Shape.

[ API set: 1.1 ]

Visio.Interfaces.ShapeDataItemCollectionUpdateData

An interface for updating data on the ShapeDataItemCollection object, for use in "shapeDataItemCollection.set({ ... })".

Visio.Interfaces.ShapeDataItemData

An interface describing the data returned by calling "shapeDataItem.toJSON()".

Visio.Interfaces.ShapeDataItemLoadOptions

Represents the ShapeDataItem.

[ API set: 1.1 ]

Visio.Interfaces.ShapeLoadOptions

Represents the Shape class.

[ API set: 1.1 ]

Visio.Interfaces.ShapeUpdateData

An interface for updating data on the Shape object, for use in "shape.set({ ... })".

Visio.Interfaces.ShapeViewData

An interface describing the data returned by calling "shapeView.toJSON()".

Visio.Interfaces.ShapeViewLoadOptions

Represents the ShapeView class.

[ API set: 1.1 ]

Visio.Interfaces.ShapeViewUpdateData

An interface for updating data on the ShapeView object, for use in "shapeView.set({ ... })".

Visio.PageLoadCompleteEventArgs

Provides information about the page that raised the PageLoadComplete event.

[ API set: 1.1 ]

Visio.PageRenderCompleteEventArgs

Provides information about the page that raised the PageRenderComplete event.

[ API set: 1.1 ]

Visio.Position

Represents the Position of the object in the view.

[ API set: 1.1 ]

Visio.SelectionChangedEventArgs

Provides information about the shape collection that raised the SelectionChanged event.

[ API set: 1.1 ]

Visio.ShapeMouseEnterEventArgs

Provides information about the shape that raised the ShapeMouseEnter event.

[ API set: 1.1 ]

Visio.ShapeMouseLeaveEventArgs

Provides information about the shape that raised the ShapeMouseLeave event.

[ API set: 1.1 ]

Enums

Visio.ErrorCodes
Visio.OverlayHorizontalAlignment

Represents the Horizontal Alignment of the Overlay relative to the shape.

[ API set: 1.1 ]

Visio.OverlayType

Represents the type of the overlay.

[ API set: 1.1 ]

Visio.OverlayVerticalAlignment

Represents the Vertical Alignment of the Overlay relative to the shape.

[ API set: 1.1 ]

Visio.ToolBarType

Toolbar IDs of the app

[ API set: 1.1 ]

Functions

Visio.run

Executes a batch script that performs actions on the Visio object model, using a new request context. When the promise is resolved, any tracked objects that were automatically allocated during execution will be released.

Visio.run_1

Executes a batch script that performs actions on the Visio object model, using the request context of a previously-created API object.

Visio.run_2

Executes a batch script that performs actions on the Visio object model, using the request context of previously-created API objects.

Visio.run_3

Executes a batch script that performs actions on the Visio object model, using the RequestContext of a previously-created object. When the promise is resolved, any tracked objects that were automatically allocated during execution will be released.

Function Details

Visio.run

Executes a batch script that performs actions on the Visio object model, using a new request context. When the promise is resolved, any tracked objects that were automatically allocated during execution will be released.

export function run<T>(batch: (context: Visio.RequestContext) => Promise<T>): Promise<T>;

Parameters

batch
(context: Visio.RequestContext) => Promise<T>

A function that takes in an Visio.RequestContext and returns a promise (typically, just the result of "context.sync()"). The context parameter facilitates requests to the Visio application. Since the Office add-in and the Visio application run in two different processes, the request context is required to get access to the Visio object model from the add-in.

Returns

Promise<T>

Visio.run_1

Executes a batch script that performs actions on the Visio object model, using the request context of a previously-created API object.

export function run<T>(object: OfficeExtension.ClientObject | OfficeExtension.EmbeddedSession, batch: (context: Visio.RequestContext) => Promise<T>): Promise<T>;

Parameters

object
OfficeExtension.ClientObject | OfficeExtension.EmbeddedSession

A previously-created API object. The batch will use the same request context as the passed-in object, which means that any changes applied to the object will be picked up by "context.sync()".

batch
(context: Visio.RequestContext) => Promise<T>

A function that takes in an Visio.RequestContext and returns a promise (typically, just the result of "context.sync()"). When the promise is resolved, any tracked objects that were automatically allocated during execution will be released.

Returns

Promise<T>

Visio.run_2

Executes a batch script that performs actions on the Visio object model, using the request context of previously-created API objects.

export function run<T>(objects: OfficeExtension.ClientObject[], batch: (context: Visio.RequestContext) => Promise<T>): Promise<T>;

Parameters

objects
OfficeExtension.ClientObject[]

An array of previously-created API objects. The array will be validated to make sure that all of the objects share the same context. The batch will use this shared request context, which means that any changes applied to these objects will be picked up by "context.sync()".

batch
(context: Visio.RequestContext) => Promise<T>

A function that takes in a Visio.RequestContext and returns a promise (typically, just the result of "context.sync()"). When the promise is resolved, any tracked objects that were automatically allocated during execution will be released.

Returns

Promise<T>

Visio.run_3

Executes a batch script that performs actions on the Visio object model, using the RequestContext of a previously-created object. When the promise is resolved, any tracked objects that were automatically allocated during execution will be released.

export function run<T>(contextObject: OfficeExtension.ClientRequestContext, batch: (context: Visio.RequestContext) => Promise<T>): Promise<T>;

Parameters

contextObject
OfficeExtension.ClientRequestContext

A previously-created Visio.RequestContext. This context will get re-used by the batch function (instead of having a new context created). This means that the batch will be able to pick up changes made to existing API objects, if those objects were derived from this same context.

batch
(context: Visio.RequestContext) => Promise<T>

A function that takes in a RequestContext and returns a promise (typically, just the result of "context.sync()"). The context parameter facilitates requests to the Visio application. Since the Office add-in and the Visio application run in two different processes, the RequestContext is required to get access to the Visio object model from the add-in.

Returns

Promise<T>

Remarks

In addition to this signature, the method also has the following signatures:

run<T>(batch: (context: Visio.RequestContext) => Promise<T>): Promise<T>;

run<T>(object: OfficeExtension.ClientObject | OfficeExtension.EmbeddedSession, batch: (context: Visio.RequestContext) => Promise<T>): Promise<T>;

run<T>(objects: OfficeExtension.ClientObject[], batch: (context: Visio.RequestContext) => Promise<T>): Promise<T>;