Edit

Share via


Visio.RequestContext class

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.

Extends

Remarks

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 RequestContext class

Properties

document

Constructor Details

(constructor)(url)

Constructs a new instance of the RequestContext class

constructor(url?: string | OfficeExtension.EmbeddedSession);

Parameters

Property Details

document

readonly document: Document;

Property Value