Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
Visio.RequestContext class
- Package:
- visio
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.
Remarks
Used by
- Visio: run
- Visio.Application: context
- Visio.Comment: context
- Visio.CommentCollection: context
- Visio.Document: context
- Visio.DocumentView: context
- Visio.Hyperlink: context
- Visio.HyperlinkCollection: context
- Visio.Page: context
- Visio.PageCollection: context
- Visio.PageView: context
- Visio.Selection: context
- Visio.Shape: context
- Visio.ShapeCollection: context
- Visio.ShapeDataItem: context
- Visio.ShapeDataItemCollection: context
- Visio.ShapeView: context
Examples
// *.run methods automatically create an OfficeExtension.ClientRequestContext
// object to work with the Office file.
Visio.run(session, function (context) {
const activePage = context.document.getActivePage();
// Interact with the Visio page...
return context.sync();
}).catch(function(error) {
console.log("Error: " + error);
if (error instanceof OfficeExtension.Error) {
console.log("Debug info: " + JSON.stringify(error.debugInfo));
}
});
Constructors
| (constructor)(url) | Constructs a new instance of the |
Properties
| document |
Constructor Details
(constructor)(url)
Constructs a new instance of the RequestContext class
constructor(url?: string | OfficeExtension.EmbeddedSession);
Parameters
- url
-
string | OfficeExtension.EmbeddedSession
Property Details
document
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Office Add-ins
Feedback
Was this page helpful?
