Word.RequestContext class
The RequestContext object facilitates requests to the Word application. Since the Office add-in and the Word application run in two different processes, the request context is required to get access to the Word object model from the add-in.
- Extends
TypeScript
// *.run methods automatically create an OfficeExtension.ClientRequestContext
// object to work with the Office file.
await Word.run(async (context: Word.RequestContext) => {
const document = context.document;
// Interact with the Word document...
});
(constructor)(url) | Constructs a new instance of the |
Constructs a new instance of the RequestContext
class
TypeScript
constructor(url?: string);
Parameters
- url
-
string
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
Office Add-ins is an open source project. Select a link to provide feedback: