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.Annotation: context
- Word.AnnotationCollection: context
- Word.Application: context
- Word.Body: context
- Word.CheckboxContentControl: context
- Word.Comment: context
- Word.CommentCollection: context
- Word.CommentContentRange: context
- Word.CommentReply: context
- Word.CommentReplyCollection: context
- Word.ContentControl: context
- Word.ContentControlCollection: context
- Word.CritiqueAnnotation: context
- Word.CustomProperty: context
- Word.CustomPropertyCollection: context
- Word.CustomXmlPart: context
- Word.CustomXmlPartCollection: context
- Word.CustomXmlPartScopedCollection: context
- Word.Document: context
- Word.DocumentCreated: context
- Word.DocumentProperties: context
- Word.Field: context
- Word.FieldCollection: context
- Word.Font: context
- Word.InlinePicture: context
- Word.InlinePictureCollection: context
- Word.List: context
- Word.ListCollection: context
- Word.ListItem: context
- Word.NoteItem: context
- Word.NoteItemCollection: context
- Word.Paragraph: context
- Word.ParagraphCollection: context
- Word.ParagraphFormat: context
- Word.Range: context
- Word.RangeCollection: context
- Word.SearchOptions: context
- Word.Section: context
- Word.SectionCollection: context
- Word.Setting: context
- Word.SettingCollection: context
- Word.Shading: context
- Word.Style: context
- Word.StyleCollection: context
- Word.Table: context
- Word.TableBorder: context
- Word.TableCell: context
- Word.TableCellCollection: context
- Word.TableCollection: context
- Word.TableRow: context
- Word.TableRowCollection: context
- Word.TableStyle: context
- Word.TrackedChange: context
- Word.TrackedChangeCollection: 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
| application | |
| document |
Constructor Details
(constructor)(url)
Constructs a new instance of the RequestContext class
constructor(url?: string);
Parameters
- url
-
string