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.
Remarks
Used by
- Word: run
- Word.Body: context
- Word.ContentControl: context
- Word.ContentControlCollection: context
- Word.Document: context
- Word.Font: context
- Word.InlinePicture: context
- Word.InlinePictureCollection: context
- Word.Paragraph: context
- Word.ParagraphCollection: context
- Word.Range: context
- Word.RangeCollection: context
- Word.SearchOptions: context
- Word.Section: context
- Word.SectionCollection: context
Examples
// *.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...
});
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);
Parameters
- url
-
string