visio package

Visio.Application

表示 Application。Represents the Application.

[API 集: 1.1][ API set: 1.1 ]

Visio.Comment

表示 Comment 对象。Represents the Comment.

[API 集: 1.1][ API set: 1.1 ]

Visio.CommentCollection

表示给定形状的 CommentCollection 对象。Represents the CommentCollection for a given Shape.

[API 集: 1.1][ API set: 1.1 ]

Visio.Document

表示 Document 类。Represents the Document class.

[API 集: 1.1][ API set: 1.1 ]

Visio.DocumentView

表示 DocumentView 类。Represents the DocumentView class.

[API 集: 1.1][ API set: 1.1 ]

Visio.Hyperlink

表示 Hyperlink 对象。Represents the Hyperlink.

[API 集: 1.1][ API set: 1.1 ]

Visio.HyperlinkCollection

表示 HyperlinkCollection 对象。Represents the Hyperlink Collection.

[API 集: 1.1][ API set: 1.1 ]

Visio.Page

表示 Page 类。Represents the Page class.

[API 集: 1.1][ API set: 1.1 ]

Visio.PageCollection

表示属于文档的 Page 对象的集合。Represents a collection of Page objects that are part of the document.

[API 集: 1.1][ API set: 1.1 ]

Visio.PageView

表示 PageView 类。Represents the PageView class.

[API 集: 1.1][ API set: 1.1 ]

Visio.RequestContext

RequestContext 对象可方便对 Visio 应用程序提出请求。The RequestContext object facilitates requests to the Visio application. 由于 Office 加载项和 Visio 应用程序在两个不同的进程中运行, 因此需要请求上下文才能从外接程序获取对 Visio 对象模型的访问权限。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

表示页面中的 Selection 对象。Represents the Selection in the page.

[API 集: 1.1][ API set: 1.1 ]

Visio.Shape

表示 Shape 类。Represents the Shape class.

[API 集: 1.1][ API set: 1.1 ]

Visio.ShapeCollection

表示 Shape 集合。Represents the Shape Collection.

[API 集: 1.1][ API set: 1.1 ]

Visio.ShapeDataItem

表示 ShapeDataItem 对象。Represents the ShapeDataItem.

[API 集: 1.1][ API set: 1.1 ]

Visio.ShapeDataItemCollection

表示给定形状的 ShapeDataItemCollection 对象。Represents the ShapeDataItemCollection for a given Shape.

[API 集: 1.1][ API set: 1.1 ]

Visio.ShapeView

表示 ShapeView 类。Represents the ShapeView class.

[API 集: 1.1][ API set: 1.1 ]

接口

Visio.BoundingBox

表示形状的 BoundingBox 对象。Represents the BoundingBox of the shape.

[API 集: 1.1][ API set: 1.1 ]

Visio.DataRefreshCompleteEventArgs

提供有关引发了 DataRefreshComplete 事件的文档的信息。Provides information about the document that raised the DataRefreshComplete event.

[API 集: 1.1][ API set: 1.1 ]

Visio.DocumentLoadCompleteEventArgs

提供有关 DocumentLoadComplete 事件的成功或失败的信息。Provides information about the success or failure of the DocumentLoadComplete event.

[API 集: 1.1][ API set: 1.1 ]

Visio.Highlight

表示添加到形状的突出显示数据。Represents the highlight data added to the shape.

[API 集: 1.1][ API set: 1.1 ]

Visio.Interfaces.ApplicationData

描述通过调用 "toJSON ()" 返回的数据的接口。An interface describing the data returned by calling "application.toJSON()".

Visio.Interfaces.ApplicationLoadOptions

表示 Application。Represents the Application.

[API 集: 1.1][ API set: 1.1 ]

Visio.Interfaces.ApplicationUpdateData

用于更新 application 对象上的数据的接口, 可用于 "application. set (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

描述通过调用 "commentCollection ()" 返回的数据的接口。An interface describing the data returned by calling "commentCollection.toJSON()".

Visio.Interfaces.CommentCollectionLoadOptions

表示给定形状的 CommentCollection 对象。Represents the CommentCollection for a given Shape.

[API 集: 1.1][ API set: 1.1 ]

Visio.Interfaces.CommentCollectionUpdateData

一个用于更新 CommentCollection 对象上的数据的接口, 可用于 "CommentCollection (An interface for updating data on the CommentCollection object, for use in "commentCollection.set({ ... })".

Visio.Interfaces.CommentData

描述通过调用 "toJSON ()" 返回的数据的接口。An interface describing the data returned by calling "comment.toJSON()".

Visio.Interfaces.CommentLoadOptions

表示 Comment 对象。Represents the Comment.

[API 集: 1.1][ API set: 1.1 ]

Visio.Interfaces.CommentUpdateData

一个用于更新 comment 对象上的数据的接口, 可用于 "comment. set (An interface for updating data on the Comment object, for use in "comment.set({ ... })".

Visio.Interfaces.DocumentData

描述通过调用 "toJSON ()" 返回的数据的接口。An interface describing the data returned by calling "document.toJSON()".

Visio.Interfaces.DocumentLoadOptions

表示 Document 类。Represents the Document class.

[API 集: 1.1][ API set: 1.1 ]

Visio.Interfaces.DocumentUpdateData

一个用于更新 document 对象上的数据的接口, 可用于 "document. set (An interface for updating data on the Document object, for use in "document.set({ ... })".

Visio.Interfaces.DocumentViewData

描述通过调用 "documentView ()" 返回的数据的接口。An interface describing the data returned by calling "documentView.toJSON()".

Visio.Interfaces.DocumentViewLoadOptions

表示 DocumentView 类。Represents the DocumentView class.

[API 集: 1.1][ API set: 1.1 ]

Visio.Interfaces.DocumentViewUpdateData

一个用于更新 DocumentView 对象上的数据的接口, 可用于 "DocumentView (An interface for updating data on the DocumentView object, for use in "documentView.set({ ... })".

Visio.Interfaces.HyperlinkCollectionData

描述通过调用 "hyperlinkCollection ()" 返回的数据的接口。An interface describing the data returned by calling "hyperlinkCollection.toJSON()".

Visio.Interfaces.HyperlinkCollectionLoadOptions

表示 HyperlinkCollection 对象。Represents the Hyperlink Collection.

[API 集: 1.1][ API set: 1.1 ]

Visio.Interfaces.HyperlinkCollectionUpdateData

一个用于更新 HyperlinkCollection 对象上的数据的接口, 可用于 "HyperlinkCollection (An interface for updating data on the HyperlinkCollection object, for use in "hyperlinkCollection.set({ ... })".

Visio.Interfaces.HyperlinkData

描述通过调用 "toJSON ()" 返回的数据的接口。An interface describing the data returned by calling "hyperlink.toJSON()".

Visio.Interfaces.HyperlinkLoadOptions

表示 Hyperlink 对象。Represents the Hyperlink.

[API 集: 1.1][ API set: 1.1 ]

Visio.Interfaces.PageCollectionData

描述通过调用 "pageCollection ()" 返回的数据的接口。An interface describing the data returned by calling "pageCollection.toJSON()".

Visio.Interfaces.PageCollectionLoadOptions

表示属于文档的 Page 对象的集合。Represents a collection of Page objects that are part of the document.

[API 集: 1.1][ API set: 1.1 ]

Visio.Interfaces.PageCollectionUpdateData

一个用于更新 PageCollection 对象上的数据的接口, 可用于 "PageCollection (An interface for updating data on the PageCollection object, for use in "pageCollection.set({ ... })".

Visio.Interfaces.PageData

描述通过调用 "toJSON ()" 返回的数据的接口。An interface describing the data returned by calling "page.toJSON()".

Visio.Interfaces.PageLoadOptions

表示 Page 类。Represents the Page class.

[API 集: 1.1][ API set: 1.1 ]

Visio.Interfaces.PageUpdateData

用于更新 page 对象上的数据的接口, 可用于 "page. set (An interface for updating data on the Page object, for use in "page.set({ ... })".

Visio.Interfaces.PageViewData

描述通过调用 "pageView ()" 返回的数据的接口。An interface describing the data returned by calling "pageView.toJSON()".

Visio.Interfaces.PageViewLoadOptions

表示 PageView 类。Represents the PageView class.

[API 集: 1.1][ API set: 1.1 ]

Visio.Interfaces.PageViewUpdateData

一个用于更新 PageView 对象上的数据的接口, 可用于 "PageView (An interface for updating data on the PageView object, for use in "pageView.set({ ... })".

Visio.Interfaces.SelectionData

描述通过调用 "toJSON ()" 返回的数据的接口。An interface describing the data returned by calling "selection.toJSON()".

Visio.Interfaces.ShapeCollectionData

描述通过调用 "shapeCollection ()" 返回的数据的接口。An interface describing the data returned by calling "shapeCollection.toJSON()".

Visio.Interfaces.ShapeCollectionLoadOptions

表示 Shape 集合。Represents the Shape Collection.

[API 集: 1.1][ API set: 1.1 ]

Visio.Interfaces.ShapeCollectionUpdateData

一个用于更新 ShapeCollection 对象上的数据的接口, 可用于 "ShapeCollection (An interface for updating data on the ShapeCollection object, for use in "shapeCollection.set({ ... })".

Visio.Interfaces.ShapeData

描述通过调用 "toJSON ()" 返回的数据的接口。An interface describing the data returned by calling "shape.toJSON()".

Visio.Interfaces.ShapeDataItemCollectionData

描述通过调用 "shapeDataItemCollection ()" 返回的数据的接口。An interface describing the data returned by calling "shapeDataItemCollection.toJSON()".

Visio.Interfaces.ShapeDataItemCollectionLoadOptions

表示给定形状的 ShapeDataItemCollection 对象。Represents the ShapeDataItemCollection for a given Shape.

[API 集: 1.1][ API set: 1.1 ]

Visio.Interfaces.ShapeDataItemCollectionUpdateData

一个用于更新 ShapeDataItemCollection 对象上的数据的接口, 可用于 "ShapeDataItemCollection (An interface for updating data on the ShapeDataItemCollection object, for use in "shapeDataItemCollection.set({ ... })".

Visio.Interfaces.ShapeDataItemData

描述通过调用 "shapeDataItem ()" 返回的数据的接口。An interface describing the data returned by calling "shapeDataItem.toJSON()".

Visio.Interfaces.ShapeDataItemLoadOptions

表示 ShapeDataItem 对象。Represents the ShapeDataItem.

[API 集: 1.1][ API set: 1.1 ]

Visio.Interfaces.ShapeLoadOptions

表示 Shape 类。Represents the Shape class.

[API 集: 1.1][ API set: 1.1 ]

Visio.Interfaces.ShapeUpdateData

用于更新 shape 对象上的数据的接口, 可用于 "shape. set (An interface for updating data on the Shape object, for use in "shape.set({ ... })".

Visio.Interfaces.ShapeViewData

描述通过调用 "shapeView ()" 返回的数据的接口。An interface describing the data returned by calling "shapeView.toJSON()".

Visio.Interfaces.ShapeViewLoadOptions

表示 ShapeView 类。Represents the ShapeView class.

[API 集: 1.1][ API set: 1.1 ]

Visio.Interfaces.ShapeViewUpdateData

一个用于更新 ShapeView 对象上的数据的接口, 可用于 "ShapeView (An interface for updating data on the ShapeView object, for use in "shapeView.set({ ... })".

Visio.PageLoadCompleteEventArgs

提供有关引发了 PageLoadComplete 事件的页面的信息。Provides information about the page that raised the PageLoadComplete event.

[API 集: 1.1][ API set: 1.1 ]

Visio.PageRenderCompleteEventArgs

提供有关引发了 PageRenderComplete 事件的页面的信息。Provides information about the page that raised the PageRenderComplete event.

[API 集: 1.1][ API set: 1.1 ]

Visio.Position

表示对象在视图中的位置。Represents the Position of the object in the view.

[API 集: 1.1][ API set: 1.1 ]

Visio.SelectionChangedEventArgs

提供有关引发了 SelectionChanged 事件的形状集合的信息。Provides information about the shape collection that raised the SelectionChanged event.

[API 集: 1.1][ API set: 1.1 ]

Visio.ShapeMouseEnterEventArgs

提供有关引发了 ShapeMouseEnter 事件的形状的信息。Provides information about the shape that raised the ShapeMouseEnter event.

[API 集: 1.1][ API set: 1.1 ]

Visio.ShapeMouseLeaveEventArgs

提供有关引发了 ShapeMouseLeave 事件的形状的信息。Provides information about the shape that raised the ShapeMouseLeave event.

[API 集: 1.1][ API set: 1.1 ]

枚举

Visio.ErrorCodes
Visio.OverlayHorizontalAlignment

表示相对于形状的覆盖方向的水平对齐方式。Represents the Horizontal Alignment of the Overlay relative to the shape.

[API 集: 1.1][ API set: 1.1 ]

Visio.OverlayType

表示覆盖的类型。Represents the type of the overlay.

[API 集: 1.1][ API set: 1.1 ]

Visio.OverlayVerticalAlignment

表示相对于形状的覆盖方向的垂直对齐方式。Represents the Vertical Alignment of the Overlay relative to the shape.

[API 集: 1.1][ API set: 1.1 ]

Visio.ToolBarType

应用程序的工具栏 idToolbar IDs of the app

[API 集: 1.1][ API set: 1.1 ]

函数

Visio.run

使用新的请求上下文执行对 Visio 对象模型执行操作的批处理脚本。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

使用以前创建的 API 对象的请求上下文, 执行对 Visio 对象模型执行操作的批处理脚本。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

使用以前创建的 API 对象的请求上下文, 执行对 Visio 对象模型执行操作的批处理脚本。Executes a batch script that performs actions on the Visio object model, using the request context of previously-created API objects.

Visio.run_3

使用以前创建的对象的 RequestContext, 执行对 Visio 对象模型执行操作的批处理脚本。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.

函数详细信息

Visio.run

使用新的请求上下文执行对 Visio 对象模型执行操作的批处理脚本。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>;

参数

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

一个采用 RequestContext 的函数, 返回一个承诺 (通常只是 "context. sync ()" 的结果)。A function that takes in an Visio.RequestContext and returns a promise (typically, just the result of "context.sync()"). Context 参数可促进对 Visio 应用程序的请求。The context parameter facilitates requests to the Visio application. 由于 Office 加载项和 Visio 应用程序在两个不同的进程中运行, 因此需要请求上下文才能从外接程序获取对 Visio 对象模型的访问权限。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.

返回

Promise<T>

Visio.run_1

使用以前创建的 API 对象的请求上下文, 执行对 Visio 对象模型执行操作的批处理脚本。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>;

参数

object
OfficeExtension.ClientObject | OfficeExtension.EmbeddedSession

以前创建的 API 对象。A previously-created API object. 批处理将使用与传入的对象相同的请求上下文, 这意味着应用于该对象的任何更改都将由 "context. sync ()" 选取。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>

一个采用 RequestContext 的函数, 返回一个承诺 (通常只是 "context. sync ()" 的结果)。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.

返回

Promise<T>

Visio.run_2

使用以前创建的 API 对象的请求上下文, 执行对 Visio 对象模型执行操作的批处理脚本。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>;

参数

objects
OfficeExtension.ClientObject[]

以前创建的 API 对象的数组。An array of previously-created API objects. 将验证该数组, 以确保所有对象都共享相同的上下文。The array will be validated to make sure that all of the objects share the same context. 批处理将使用此共享请求上下文, 这意味着应用于这些对象的任何更改都将由 "context. sync ()" 选取。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>

一个采用 RequestContext 的函数, 返回一个承诺 (通常只是 "context. sync ()" 的结果)。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.

返回

Promise<T>

Visio.run_3

使用以前创建的对象的 RequestContext, 执行对 Visio 对象模型执行操作的批处理脚本。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>;

参数

contextObject
OfficeExtension.ClientRequestContext

以前创建的 RequestContext。A previously-created Visio.RequestContext. 此上下文将由批处理函数重新使用 (而不是创建新的上下文)。This context will get re-used by the batch function (instead of having a new context created). 这意味着批处理将能够选取对现有 API 对象所做的更改 (如果这些对象是从该相同的上下文派生的)。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>

一个采用 RequestContext 的函数, 并返回一个承诺 (通常只是 "context. sync ()" 的结果)。A function that takes in a RequestContext and returns a promise (typically, just the result of "context.sync()"). Context 参数可促进对 Visio 应用程序的请求。The context parameter facilitates requests to the Visio application. 由于 Office 加载项和 Visio 应用程序在两个不同的进程中运行, 因此需要 RequestContext 以从外接程序获取对 Visio 对象模型的访问权限。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.

返回

Promise<T>

注解

除了此签名之外, 该方法还具有以下签名: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>;