Tell us about your PDF experience.
excel package
Reference
Classes
Excel.AllowEditRange Represents an AllowEditRange object found in a worksheet. This
object works with worksheet protection properties. When
worksheet protection is enabled, an AllowEditRange object can
be used to allow editing of a specific range, while maintaining
protection on the rest of the worksheet.
Excel.AllowEditRange Represents the set of AllowEditRange objects found in a
Collection worksheet. AllowEditRange objects work with worksheet
protection properties. When worksheet protection is enabled, an
AllowEditRange object can be used to allow editing of a specific
range, while maintaining protection on the rest of the worksheet.
Excel.Application Represents the Excel application that manages the workbook.
Excel.AutoFilter Represents the AutoFilter object. AutoFilter turns the values in
Excel column into specific filters based on the cell contents.
Excel.Binding Represents an Office.js binding that is defined in the workbook.
Excel.BindingCollection Represents the collection of all the binding objects that are part
of the workbook.
Excel.CellValueConditional Represents a cell value conditional format.
Format
Excel.Chart Represents a chart object in a workbook. To learn more about
the chart object model, see Work with charts using the Excel
JavaScript API.
Excel.ChartAreaFormat Encapsulates the format properties for the overall chart area.
Excel.ChartAxes Represents the chart axes.
Excel.ChartAxis Represents a single axis in a chart.
Excel.ChartAxisFormat Encapsulates the format properties for the chart axis.
Excel.ChartAxisTitle Represents the title of a chart axis.
Excel.ChartAxisTitleFormat Represents the chart axis title formatting.
Excel.ChartBinOptions Encapsulates the bin options for histogram charts and pareto
charts.
Excel.ChartBorder Represents the border formatting of a chart element.
Excel.ChartBoxwhiskerOptions Represents the properties of a box and whisker chart.
Excel.ChartCollection A collection of all the chart objects on a worksheet.
Excel.ChartDataLabel Represents the data label of a chart point.
Excel.ChartDataLabelFormat Encapsulates the format properties for the chart data labels.
Excel.ChartDataLabels Represents a collection of all the data labels on a chart point.
Excel.ChartDataTable Represents the data table object of a chart.
Excel.ChartDataTableFormat Represents the format of a chart data table.
Excel.ChartErrorBars This object represents the attributes for a chart's error bars.
Excel.ChartErrorBarsFormat Encapsulates the format properties for chart error bars.
Excel.ChartFill Represents the fill formatting for a chart element.
Excel.ChartFont This object represents the font attributes (such as font name,
font size, and color) for a chart object.
Excel.ChartFormatString Represents the substring in chart related objects that contain
text, like a ChartTitle object or ChartAxisTitle object.
Excel.ChartGridlines Represents major or minor gridlines on a chart axis.
Excel.ChartGridlinesFormat Encapsulates the format properties for chart gridlines.
Excel.ChartLegend Represents the legend in a chart.
Excel.ChartLegendEntry Represents the legend entry in legendEntryCollection .
Excel.ChartLegendEntry Represents a collection of legend entries.
Collection
Excel.ChartLegendFormat Encapsulates the format properties of a chart legend.
Excel.ChartLineFormat Encapsulates the formatting options for line elements.
Excel.ChartMapOptions Encapsulates the properties for a region map chart.
Excel.ChartPivotOptions Encapsulates the options for the pivot chart.
Excel.ChartPlotArea This object represents the attributes for a chart plot area.
Excel.ChartPlotAreaFormat Represents the format properties for a chart plot area.
Excel.ChartPoint Represents a point of a series in a chart.
Excel.ChartPointFormat Represents the formatting object for chart points.
Excel.ChartPointsCollection A collection of all the chart points within a series inside a chart.
Excel.ChartSeries Represents a series in a chart.
Excel.ChartSeriesCollection Represents a collection of chart series.
Excel.ChartSeriesFormat Encapsulates the format properties for the chart series
Excel.ChartTitle Represents a chart title object of a chart.
Excel.ChartTitleFormat Provides access to the formatting options for a chart title.
Excel.ChartTrendline This object represents the attributes for a chart trendline object.
Excel.ChartTrendlineCollection Represents a collection of chart trendlines.
Excel.ChartTrendlineFormat Represents the format properties for the chart trendline.
Excel.ChartTrendlineLabel This object represents the attributes for a chart trendline label
object.
Excel.ChartTrendlineLabel Encapsulates the format properties for the chart trendline label.
Format
Excel.ColorScaleConditional Represents the color scale criteria for conditional formatting.
Format
Excel.Comment Represents a comment in the workbook.
Excel.CommentCollection Represents a collection of comment objects that are part of the
workbook.
Excel.CommentReply Represents a comment reply in the workbook.
Excel.CommentReply Represents a collection of comment reply objects that are part of
Collection the comment.
Excel.ConditionalDataBar Represents a conditional format for the negative side of the data
NegativeFormat bar.
Excel.ConditionalDataBar Represents a conditional format for the positive side of the data
PositiveFormat bar.
Excel.ConditionalFormat An object encapsulating a conditional format's range, format,
rule, and other properties. To learn more about the conditional
formatting object model, read Apply conditional formatting to
Excel ranges.
Excel.ConditionalFormat Represents a collection of all the conditional formats that are
Collection overlap the range.
Excel.ConditionalFormatRule Represents a rule, for all traditional rule/format pairings.
Excel.ConditionalRangeBorder Represents the border of an object.
Excel.ConditionalRangeBorder Represents the border objects that make up range border.
Collection
Excel.ConditionalRangeFill Represents the background of a conditional range object.
Excel.ConditionalRangeFont This object represents the font attributes (font style, color, etc.)
for an object.
Excel.ConditionalRangeFormat A format object encapsulating the conditional formats range's
font, fill, borders, and other properties.
Excel.CultureInfo Provides information based on current system culture settings.
This includes the culture names, number formatting, and other
culturally dependent settings.
Excel.CustomConditional Represents a custom conditional format type.
Format
Excel.CustomProperty Represents a custom property.
Excel.CustomProperty Contains the collection of custom properties.
Collection
Excel.CustomXmlPart Represents a custom XML part object in a workbook.
Excel.CustomXmlPart A collection of custom XML parts.
Collection
Excel.CustomXmlPartScoped A scoped collection of custom XML parts. A scoped collection is
Collection the result of some operation (e.g., filtering by namespace). A
scoped collection cannot be scoped any further.
Excel.DataBarConditional Represents an Excel conditional data bar type.
Format
Excel.DataConnection Represents a collection of all the data connections that are part
Collection of the workbook.
Excel.DataPivotHierarchy Represents the Excel DataPivotHierarchy.
Excel.DataPivotHierarchy Represents a collection of DataPivotHierarchy items associated
Collection with the PivotTable.
Excel.DataValidation Represents the data validation applied to the current range. To
learn more about the data validation object model, read Add
data validation to Excel ranges.
Excel.DatetimeFormatInfo Defines the culturally appropriate format of displaying numbers.
This is based on current system culture settings.
Excel.DocumentProperties Represents workbook properties.
Excel.DocumentTask Represents a task.
Excel.DocumentTaskChange Represents a recorded change to the task.
Excel.DocumentTaskChange Represents a collection of change records for a task.
Collection
Excel.DocumentTaskCollection Represents a collection of tasks.
Excel.Filter Manages the filtering of a table's column.
Excel.FilterPivotHierarchy Represents the Excel FilterPivotHierarchy.
Excel.FilterPivotHierarchy Represents a collection of FilterPivotHierarchy items associated
Collection with the PivotTable.
Excel.FormatProtection Represents the format protection of a range object.
Excel.FunctionResult An object containing the result of a function-evaluation
operation
Excel.Functions An object for evaluating Excel functions.
Excel.GeometricShape Represents a geometric shape inside a worksheet. A geometric
shape can be a rectangle, block arrow, equation symbol,
flowchart item, star, banner, callout, or any other basic shape in
Excel.
Excel.GroupShapeCollection Represents the shape collection inside a shape group.
Excel.HeaderFooter
Excel.HeaderFooterGroup
Excel.IconSetConditional Represents an icon set criteria for conditional formatting.
Format
Excel.Image Represents an image in the worksheet. To get the corresponding
Shape object, use Image.shape .
Excel.IterativeCalculation Represents the iterative calculation settings.
Excel.Line Represents a line inside a worksheet. To get the corresponding
Shape object, use Line.shape .
Excel.LinkedDataType Represents a linked data type. A linked data type is a data type
connected to an online data source.
Excel.LinkedDataType Represents a collection of linked data types.
Collection
Excel.LinkedWorkbook Contains information about a linked workbook. If a workbook
has links pointing to data in another workbook, the second
workbook is linked to the first workbook. In this scenario, the
second workbook is called the "linked workbook".
Excel.LinkedWorkbook Represents a collection of linked workbook objects.
Collection
Excel.NamedItem Represents a defined name for a range of cells or value. Names
can be primitive named objects (as seen in the type below),
range object, or a reference to a range. This object can be used
to obtain range object associated with names.
Excel.NamedItemArrayValues Represents an object containing values and types of a named
item.
Excel.NamedItemCollection A collection of all the NamedItem objects that are part of the
workbook or worksheet, depending on how it was reached.
Excel.NamedSheetView Represents a named sheet view of a worksheet. A sheet view
stores the sort and filter rules for a particular worksheet. Every
sheet view (even a temporary sheet view) has a unique,
worksheet-scoped name that is used to access the view.
Excel.NamedSheetView Represents the collection of sheet views in the worksheet.
Collection
Excel.NumberFormatInfo Defines the culturally appropriate format of displaying numbers.
This is based on current system culture settings.
Excel.PageBreak
Excel.PageBreakCollection
Excel.PageLayout Represents layout and print settings that are not dependent on
any printer-specific implementation. These settings include
margins, orientation, page numbering, title rows, and print area.
Excel.PivotField Represents the Excel PivotField.
Excel.PivotFieldCollection Represents a collection of all the PivotFields that are part of a
PivotTable's hierarchy.
Excel.PivotHierarchy Represents the Excel PivotHierarchy.
Excel.PivotHierarchyCollection Represents a collection of all the PivotHierarchies that are part of
the PivotTable.
Excel.PivotItem Represents the Excel PivotItem.
Excel.PivotItemCollection Represents a collection of all the PivotItems related to their
parent PivotField.
Excel.PivotLayout Represents the visual layout of the PivotTable.
Excel.PivotTable Represents an Excel PivotTable. To learn more about the
PivotTable object model, read Work with PivotTables using the
Excel JavaScript API.
Excel.PivotTableCollection Represents a collection of all the PivotTables that are part of the
workbook or worksheet.
Excel.PivotTableScoped Represents a scoped collection of PivotTables. The PivotTables
Collection are sorted based on the location of the PivotTable's top-left
corner. They are ordered top-to-bottom and then left-to-right.
Excel.PivotTableStyle Represents a PivotTable style, which defines style elements by
PivotTable region.
Excel.PivotTableStyleCollection Represents a collection of PivotTable styles.
Excel.PresetCriteriaConditional Represents the preset criteria conditional format such as above
Format average, below average, unique values, contains blank, nonblank,
error, and noerror.
Excel.Query Represents a Power Query query.
Excel.QueryCollection Represents the collection of queries in the workbook.
Excel.Range Range represents a set of one or more contiguous cells such as a
cell, a row, a column, or a block of cells. To learn more about
how ranges are used throughout the API, start with Ranges in
the Excel JavaScript API.
Excel.RangeAreas RangeAreas represents a collection of one or more rectangular
ranges in the same worksheet. To learn how to use discontiguous
ranges, read Work with multiple ranges simultaneously in Excel
add-ins.
Excel.RangeAreasCollection Contains the collection of cross-workbook level ranges.
Excel.RangeBorder Represents the border of an object.
Excel.RangeBorderCollection Represents the border objects that make up the range border.
Excel.RangeCollection
Excel.RangeFill Represents the background of a range object.
Excel.RangeFont This object represents the font attributes (font name, font size,
color, etc.) for an object.
Excel.RangeFormat A format object encapsulating the range's font, fill, borders,
alignment, and other properties.
Excel.RangeSort Manages sorting operations on Range objects.
Excel.RangeView RangeView represents a set of visible cells of the parent range.
Excel.RangeViewCollection Represents a collection of RangeView objects.
Excel.RemoveDuplicatesResult Represents the results from Range.removeDuplicates .
Excel.RequestContext The RequestContext object facilitates requests to the Excel
application. Since the Office add-in and the Excel application run
in two different processes, the request context is required to get
access to the Excel object model from the add-in.
Excel.RowColumnPivot Represents the Excel RowColumnPivotHierarchy.
Hierarchy
Excel.RowColumnPivot Represents a collection of RowColumnPivotHierarchy items
HierarchyCollection associated with the PivotTable.
Excel.Runtime Represents the Excel Runtime class.
Excel.Setting Setting represents a key-value pair of a setting persisted to the
document (per file, per add-in). These custom key-value pair can
be used to store state or lifecycle information needed by the
content or task-pane add-in. Note that settings are persisted in
the document and hence it is not a place to store any sensitive
or protected information such as user information and password.
Excel.SettingCollection Represents a collection of key-value pair setting objects that are
part of the workbook. The scope is limited to per file and add-in
(task-pane or content) combination.
Excel.Shape Represents a generic shape object in the worksheet. A shape
could be a geometric shape, a line, a group of shapes, etc. To
learn more about the shape object model, read Work with
shapes using the Excel JavaScript API.
Excel.ShapeCollection Represents a collection of all the shapes in the worksheet.
Excel.ShapeFill Represents the fill formatting of a shape object.
Excel.ShapeFont Represents the font attributes, such as font name, font size, and
color, for a shape's TextRange object.
Excel.ShapeGroup Represents a shape group inside a worksheet. To get the
corresponding Shape object, use ShapeGroup.shape .
Excel.ShapeLineFormat Represents the line formatting for the shape object. For images
and geometric shapes, line formatting represents the border of
the shape.
Excel.Slicer Represents a Slicer object in the workbook.
Excel.SlicerCollection Represents a collection of all the slicer objects in the workbook
or a worksheet.
Excel.SlicerItem Represents a slicer item in a slicer.
Excel.SlicerItemCollection Represents a collection of all the slicer item objects in the slicer.
Excel.SlicerStyle Represents a slicer style, which defines style elements by region
of the slicer.
Excel.SlicerStyleCollection Represents a collection of SlicerStyle objects.
Excel.Style An object encapsulating a style's format and other properties.
Excel.StyleCollection Represents a collection of all the styles.
Excel.Table Represents an Excel table. To learn more about the table object
model, read Work with tables using the Excel JavaScript API.
Excel.TableCollection Represents a collection of all the tables that are part of the
workbook or worksheet, depending on how it was reached.
Excel.TableColumn Represents a column in a table.
Excel.TableColumnCollection Represents a collection of all the columns that are part of the
table.
Excel.TableRow Represents a row in a table.
Note that unlike ranges or columns, which will adjust if new rows
or columns are added before them, a TableRow object represents
the physical location of the table row, but not the data. That is, if
the data is sorted or if new rows are added, a table row will
continue to point at the index for which it was created.
Excel.TableRowCollection Represents a collection of all the rows that are part of the table.
Note that unlike ranges or columns, which will adjust if new rows
or columns are added before them, a TableRow object represents
the physical location of the table row, but not the data. That is, if
the data is sorted or if new rows are added, a table row will
continue to point at the index for which it was created.
Excel.TableScopedCollection Represents a scoped collection of tables. For each table its top-
left corner is considered its anchor location, and the tables are
sorted top-to-bottom and then left-to-right.
Excel.TableSort Manages sorting operations on Table objects.
Excel.TableStyle Represents a table style, which defines the style elements by
region of the table.
Excel.TableStyleCollection Represents a collection of table styles.
Excel.TextConditionalFormat Represents a specific text conditional format.
Excel.TextFrame Represents the text frame of a shape object.
Excel.TextRange Contains the text that is attached to a shape, in addition to
properties and methods for manipulating the text.
Excel.TimelineStyle Represents a TimelineStyle , which defines style elements by
region in the timeline.
Excel.TimelineStyleCollection Represents a collection of timeline styles.
Excel.TopBottomConditional Represents a top/bottom conditional format.
Format
Excel.Workbook Workbook is the top level object which contains related
workbook objects such as worksheets, tables, and ranges. To
learn more about the workbook object model, read Work with
workbooks using the Excel JavaScript API.
Excel.WorkbookCreated The WorkbookCreated object is the top level object created by
Application.CreateWorkbook . A WorkbookCreated object is a
special Workbook object.
Excel.WorkbookProtection Represents the protection of a workbook object.
Excel.WorkbookRangeAreas Represents a collection of one or more rectangular ranges in
multiple worksheets.
Excel.Worksheet An Excel worksheet is a grid of cells. It can contain data, tables,
charts, etc. To learn more about the worksheet object model,
read Work with worksheets using the Excel JavaScript API.
Excel.WorksheetCollection Represents a collection of worksheet objects that are part of the
workbook.
Excel.WorksheetCustom Represents a worksheet-level custom property.
Property
Excel.WorksheetCustom Contains the collection of worksheet-level custom property.
PropertyCollection
Excel.WorksheetFreezePanes
Excel.WorksheetProtection Represents the protection of a worksheet object.
Interfaces
Excel.AllowEditRangeOptions The interface used to construct optional fields of the
AllowEditRange object.
Excel.ArrayCellValue Represents a 2D array of cell values.
Excel.Base64EncodedImage The base64 encoding type and data of an image.
Excel.BasicDataValidation Represents the basic type data validation criteria.
Excel.BindingDataChanged Provides information about the binding that raised the data
EventArgs changed event.
Excel.BindingSelection Provides information about the selection that raised the
ChangedEventArgs selection changed event.
Note*: If multiple, discontiguous cells are selected,
Binding.onSelectionChanged only reports row and column
information for one selection. Use Worksheet.onSelectionChanged
for multiple selected ranges.
Excel.BlockedErrorCellValue Represents the value of a cell containing a #BLOCKED! error.
Excel.BooleanCellValue Represents the value of a cell containing a boolean.
Excel.BusyErrorCellValue Represents the value of a cell containing a #BUSY! error.
Excel.CalcErrorCellValue Represents the value of a cell containing a #CALC! error.
Excel.CardLayoutListSection Represents a section of a card that is arranged as a list in card
view.
Excel.CardLayoutProperty Represents a reference to a property used by the card layout.
Reference
Excel.CardLayoutSection Properties of a card layout relevant to most card layouts.
StandardProperties
Excel.CardLayoutStandard Properties of a card layout relevant to most card layouts.
Properties
Excel.CardLayoutTableSection Represents a section of a card that is arranged as a table in card
view.
Excel.CellBorder Represents the properties of a single border returned by
getCellProperties , getRowProperties , and getColumnProperties ,
or the border property input parameter of setCellProperties ,
setRowProperties , and setColumnProperties .
Excel.CellBorderCollection Represents the format.borders properties of getCellProperties ,
getRowProperties , and getColumnProperties , or the
format.borders input parameter of setCellProperties ,
setRowProperties , and setColumnProperties .
Excel.CellProperties Represents the returned properties of getCellProperties.
[ API set: ExcelApi 1.9 ]
Excel.CellPropertiesBorder
LoadOptions Specifies which properties to load on the format.borders object.
Excel.CellPropertiesFill Represents the format.fill properties of getCellProperties ,
getRowProperties , and getColumnProperties or the format.fill
input parameter of setCellProperties , setRowProperties , and
setColumnProperties .
Excel.CellPropertiesFillLoad Specifies which properties to load on the format.fill object.
Options
Excel.CellPropertiesFont Represents the format.font properties of getCellProperties ,
getRowProperties , and getColumnProperties , or the format.font
input parameter of setCellProperties , setRowProperties , and
setColumnProperties .
Excel.CellPropertiesFontLoad Specifies which properties to load on the format.font object.
Options
Excel.CellPropertiesFormat Represents the returned format properties of getCellProperties
or format input parameter of setCellProperties.
[ API set: ExcelApi 1.9 ]
Excel.CellPropertiesFormat Represents which properties to load on the format object.
LoadOptions
[ API set: ExcelApi 1.9 ]
Excel.CellPropertiesLoad Represents which cell properties to load, when used as part of a
Options "range.getCellProperties" method.
[ API set: ExcelApi 1.9 ]
Excel.CellPropertiesProtection Represents the format.protection properties of
getCellProperties , getRowProperties , and getColumnProperties ,
or the format.protection input parameter of setCellProperties ,
setRowProperties , and setColumnProperties .
Excel.CellValueAttribution The attribution attributes object represents the set of details that
Attributes can be used to describe where information came from, if the
information comes from a public source.
Excel.CellValueExtraProperties These extra properties may appear on a CellValue and provide
information about that CellValue , but the extra properties are
not part of the value in the cell.
Excel.CellValueProperty Metadata about a property in EntityCellValue.properties .
Metadata
Excel.CellValueProperty Represents the exclusion of a property in
MetadataExclusions EntityCellValue.properties from features of Excel.
Excel.CellValueProvider The provider attributes object represents the set of details used
Attributes in card view to provide specified branding information for a
CellValue type that supports provider attributes.
Excel.ChangedEventDetail Provides information about the details of a
WorksheetChangedEvent or TableChangedEvent .
Excel.ChangeDirectionState Represents the direction that existing or remaining cells in a
worksheet will shift when cells are inserted into or deleted from a
worksheet.
Excel.ChartActivatedEventArgs Provides information about the chart that raised the activated
event.
Excel.ChartAddedEventArgs Provides information about the chart that raised the added
event.
Excel.ChartDeactivatedEvent Provides information about the chart that raised the deactivated
Args event.
Excel.ChartDeletedEventArgs Provides information about the chart that raised the deleted
event.
Excel.ColumnProperties Represents the returned properties of getColumnProperties.
[ API set: ExcelApi 1.9 ]
Excel.ColumnPropertiesLoad Represents which column properties to load, when used as part
Options of a "range.getColumnProperties" method.
[ API set: ExcelApi 1.9 ]
Excel.CommentAddedEvent Provides information about the comments that raised the
Args comment added event.
Excel.CommentChangedEvent Occurs when existing comments are changed.
Args
Excel.CommentDeletedEvent Provides information about the comments that raised the
Args comment deleted event.
Excel.CommentDetail A structure for the comment ID and IDs of its related replies.
Excel.CommentMention Represents the entity that is mentioned in comments.
Excel.CommentRichContent Represents the content contained within a comment or
comment reply. Rich content incudes the text string and any
other objects contained within the comment body, such as
mentions.
Excel.ConditionalCellValue Represents a cell value conditional format rule.
Rule
Excel.ConditionalColorScale Represents the criteria of the color scale.
Criteria
Excel.ConditionalColorScale Represents a color scale criterion which contains a type, value,
Criterion and a color.
Excel.ConditionalDataBarRule Represents a rule-type for a data bar.
Excel.ConditionalIconCriterion Represents an icon criterion which contains a type, value, an
operator, and an optional custom icon, if not using an icon set.
Excel.ConditionalPresetCriteria Represents the preset criteria conditional format rule.
Rule
Excel.ConditionalText Represents a cell value conditional format rule.
ComparisonRule
Excel.ConditionalTopBottom Represents the rule of the top/bottom conditional format.
Rule
Excel.ConnectErrorCellValue Represents the value of a cell containing a #CONNECT! error.
Excel.CustomDataValidation Represents the custom data validation criteria.
Excel.DataValidationErrorAlert Represents the error alert properties for the data validation.
Excel.DataValidationPrompt Represents the user prompt properties for the data validation.
Excel.DataValidationRule A data validation rule contains different types of data validation.
You can only use one of them at a time according the
Excel.DataValidationType .
Excel.DateTimeDataValidation Represents the date data validation criteria.
Excel.Div0ErrorCellValue Represents the value of a cell containing a #DIV/0! error.
Excel.DocumentTaskChange Represents a recorded change to the task, to be used as an input
Properties parameter.
Excel.DocumentTaskSchedule Represents information about a task's schedule.
Excel.DoubleCellValue Represents the value of a cell containing a double.
Excel.EmailIdentity Represents information about a user's identity.
Excel.EmptyCellValue Represents the value of a cell that's empty and has no formulas
or data.
Excel.EntityArrayCardLayout Represents a card layout that is best used for an array.
Excel.EntityCardLayout Represents a card layout that is best used for an array.
Excel.EntityCellValue Represents a set of properties without a schema or defined
structure.
Excel.EntityCompactLayout The compact layout properties for an entity.
Excel.EntityPropertyExtra Properties used by CellValueAndPropertyMetadata . These
Properties properties refer to the metadata and not to a CellValue .
Excel.EntityViewLayouts Represents layout information for various views of the entity.
Excel.ExternalErrorCellValue Represents the value of a cell containing an #EXTERNAL! error.
Excel.FieldErrorCellValue Represents the value of a cell containing a #FIELD! error.
Excel.FilterCriteria Represents the filtering criteria applied to a column.
Excel.FilterDatetime Represents how to filter a date when filtering on values.
Excel.FiveArrowsGraySet [ API set: ExcelApi 1.2 ]
Excel.FiveArrowsSet [ API set: ExcelApi 1.2 ]
Excel.FiveBoxesSet [ API set: ExcelApi 1.2 ]
Excel.FiveQuartersSet [ API set: ExcelApi 1.2 ]
Excel.FiveRatingSet [ API set: ExcelApi 1.2 ]
Excel.FormattedNumberCell Represents the value of a cell containing a number with a format
Value string. Number format strings must conform to Excel guidelines.
To learn more, see Review guidelines for customizing a number
format . In this scenario, the format is applied to the value and
not to the cell, so the value retains its format string throughout
calculation.
Excel.FormulaChangedEvent Provides information about a changed formula during a formula
Detail changed event.
Excel.FourArrowsGraySet [ API set: ExcelApi 1.2 ]
Excel.FourArrowsSet [ API set: ExcelApi 1.2 ]
Excel.FourRatingSet [ API set: ExcelApi 1.2 ]
Excel.FourRedToBlackSet [ API set: ExcelApi 1.2 ]
Excel.FourTrafficLightsSet [ API set: ExcelApi 1.2 ]
Excel.GettingDataErrorCell Represents the value of a cell containing a #GETTING_DATA
Value error.
Excel.Icon Represents a cell icon.
Excel.IconCollections [ API set: ExcelApi 1.2 ]
Excel.Identity Represents information about a user's identity.
Excel.InsertWorksheetOptions The options that define which worksheets to insert and where in
the workbook the new worksheets will be inserted.
Excel.Interfaces.AllowEdit An interface describing the data returned by calling
RangeCollectionData allowEditRangeCollection.toJSON() .
Excel.Interfaces.AllowEdit Represents the set of AllowEditRange objects found in a
RangeCollectionLoadOptions worksheet. AllowEditRange objects work with worksheet
protection properties. When worksheet protection is enabled, an
AllowEditRange object can be used to allow editing of a specific
range, while maintaining protection on the rest of the worksheet.
Excel.Interfaces.AllowEdit An interface for updating data on the AllowEditRangeCollection
RangeCollectionUpdateData object, for use in allowEditRangeCollection.set({ ... }) .
Excel.Interfaces.AllowEdit An interface describing the data returned by calling
RangeData allowEditRange.toJSON() .
Excel.Interfaces.AllowEdit Represents an AllowEditRange object found in a worksheet. This
RangeLoadOptions object works with worksheet protection properties. When
worksheet protection is enabled, an AllowEditRange object can
be used to allow editing of a specific range, while maintaining
protection on the rest of the worksheet.
Excel.Interfaces.AllowEdit An interface for updating data on the AllowEditRange object, for
RangeUpdateData use in allowEditRange.set({ ... }) .
Excel.Interfaces.Application An interface describing the data returned by calling
Data application.toJSON() .
Excel.Interfaces.Application Represents the Excel application that manages the workbook.
LoadOptions
Excel.Interfaces.Application An interface for updating data on the Application object, for use
UpdateData in application.set({ ... }) .
Excel.Interfaces.AutoFilterData An interface describing the data returned by calling
autoFilter.toJSON() .
Excel.Interfaces.AutoFilterLoad Represents the AutoFilter object. AutoFilter turns the values in
Options Excel column into specific filters based on the cell contents.
Excel.Interfaces.Binding An interface describing the data returned by calling
CollectionData bindingCollection.toJSON() .
Excel.Interfaces.Binding Represents the collection of all the binding objects that are part
CollectionLoadOptions of the workbook.
Excel.Interfaces.Binding An interface for updating data on the BindingCollection object,
CollectionUpdateData for use in bindingCollection.set({ ... }) .
Excel.Interfaces.BindingData An interface describing the data returned by calling
binding.toJSON() .
Excel.Interfaces.BindingLoad Represents an Office.js binding that is defined in the workbook.
Options
Excel.Interfaces.CellValue An interface describing the data returned by calling
ConditionalFormatData cellValueConditionalFormat.toJSON() .
Excel.Interfaces.CellValue Represents a cell value conditional format.
ConditionalFormatLoad
Options
Excel.Interfaces.CellValue An interface for updating data on the
ConditionalFormatUpdate CellValueConditionalFormat object, for use in
Data cellValueConditionalFormat.set({ ... }) .
Excel.Interfaces.ChartArea An interface describing the data returned by calling
FormatData chartAreaFormat.toJSON() .
Excel.Interfaces.ChartArea Encapsulates the format properties for the overall chart area.
FormatLoadOptions
Excel.Interfaces.ChartArea An interface for updating data on the ChartAreaFormat object,
FormatUpdateData for use in chartAreaFormat.set({ ... }) .
Excel.Interfaces.ChartAxesData An interface describing the data returned by calling
chartAxes.toJSON() .
Excel.Interfaces.ChartAxes Represents the chart axes.
LoadOptions
Excel.Interfaces.ChartAxes An interface for updating data on the ChartAxes object, for use
UpdateData in chartAxes.set({ ... }) .
Excel.Interfaces.ChartAxisData An interface describing the data returned by calling
chartAxis.toJSON() .
Excel.Interfaces.ChartAxis An interface describing the data returned by calling
FormatData chartAxisFormat.toJSON() .
Excel.Interfaces.ChartAxis Encapsulates the format properties for the chart axis.
FormatLoadOptions
Excel.Interfaces.ChartAxis An interface for updating data on the ChartAxisFormat object,
FormatUpdateData for use in chartAxisFormat.set({ ... }) .
Excel.Interfaces.ChartAxisLoad Represents a single axis in a chart.
Options
Excel.Interfaces.ChartAxisTitle An interface describing the data returned by calling
Data chartAxisTitle.toJSON() .
Excel.Interfaces.ChartAxisTitle An interface describing the data returned by calling
FormatData chartAxisTitleFormat.toJSON() .
Excel.Interfaces.ChartAxisTitle Represents the chart axis title formatting.
FormatLoadOptions
Excel.Interfaces.ChartAxisTitle An interface for updating data on the ChartAxisTitleFormat
FormatUpdateData object, for use in chartAxisTitleFormat.set({ ... }) .
Excel.Interfaces.ChartAxisTitle Represents the title of a chart axis.
LoadOptions
Excel.Interfaces.ChartAxisTitle An interface for updating data on the ChartAxisTitle object, for
UpdateData use in chartAxisTitle.set({ ... }) .
Excel.Interfaces.ChartAxis An interface for updating data on the ChartAxis object, for use in
UpdateData chartAxis.set({ ... }) .
Excel.Interfaces.ChartBin An interface describing the data returned by calling
OptionsData chartBinOptions.toJSON() .
Excel.Interfaces.ChartBin Encapsulates the bin options for histogram charts and pareto
OptionsLoadOptions charts.
Excel.Interfaces.ChartBin An interface for updating data on the ChartBinOptions object,
OptionsUpdateData for use in chartBinOptions.set({ ... }) .
Excel.Interfaces.ChartBorder An interface describing the data returned by calling
Data chartBorder.toJSON() .
Excel.Interfaces.ChartBorder Represents the border formatting of a chart element.
LoadOptions
Excel.Interfaces.ChartBorder An interface for updating data on the ChartBorder object, for use
UpdateData in chartBorder.set({ ... }) .
Excel.Interfaces.Chart An interface describing the data returned by calling
BoxwhiskerOptionsData chartBoxwhiskerOptions.toJSON() .
Excel.Interfaces.Chart Represents the properties of a box and whisker chart.
BoxwhiskerOptionsLoad
Options
Excel.Interfaces.Chart An interface for updating data on the ChartBoxwhiskerOptions
BoxwhiskerOptionsUpdate object, for use in chartBoxwhiskerOptions.set({ ... }) .
Data
Excel.Interfaces.Chart An interface describing the data returned by calling
CollectionData chartCollection.toJSON() .
Excel.Interfaces.Chart A collection of all the chart objects on a worksheet.
CollectionLoadOptions
Excel.Interfaces.Chart An interface for updating data on the ChartCollection object, for
CollectionUpdateData use in chartCollection.set({ ... }) .
Excel.Interfaces.ChartData An interface describing the data returned by calling
chart.toJSON() .
Excel.Interfaces.ChartData An interface describing the data returned by calling
LabelData chartDataLabel.toJSON() .
Excel.Interfaces.ChartData An interface describing the data returned by calling
LabelFormatData chartDataLabelFormat.toJSON() .
Excel.Interfaces.ChartData Encapsulates the format properties for the chart data labels.
LabelFormatLoadOptions
Excel.Interfaces.ChartData An interface for updating data on the ChartDataLabelFormat
LabelFormatUpdateData object, for use in chartDataLabelFormat.set({ ... }) .
Excel.Interfaces.ChartData Represents the data label of a chart point.
LabelLoadOptions
Excel.Interfaces.ChartData An interface describing the data returned by calling
LabelsData chartDataLabels.toJSON() .
Excel.Interfaces.ChartData Represents a collection of all the data labels on a chart point.
LabelsLoadOptions
Excel.Interfaces.ChartData An interface for updating data on the ChartDataLabels object, for
LabelsUpdateData use in chartDataLabels.set({ ... }) .
Excel.Interfaces.ChartData An interface for updating data on the ChartDataLabel object, for
LabelUpdateData use in chartDataLabel.set({ ... }) .
Excel.Interfaces.ChartData An interface describing the data returned by calling
TableData chartDataTable.toJSON() .
Excel.Interfaces.ChartData An interface describing the data returned by calling
TableFormatData chartDataTableFormat.toJSON() .
Excel.Interfaces.ChartData Represents the format of a chart data table.
TableFormatLoadOptions
Excel.Interfaces.ChartData An interface for updating data on the ChartDataTableFormat
TableFormatUpdateData object, for use in chartDataTableFormat.set({ ... }) .
Excel.Interfaces.ChartData Represents the data table object of a chart.
TableLoadOptions
Excel.Interfaces.ChartData An interface for updating data on the ChartDataTable object, for
TableUpdateData use in chartDataTable.set({ ... }) .
Excel.Interfaces.ChartErrorBars An interface describing the data returned by calling
Data chartErrorBars.toJSON() .
Excel.Interfaces.ChartErrorBars An interface describing the data returned by calling
FormatData chartErrorBarsFormat.toJSON() .
Excel.Interfaces.ChartErrorBars Encapsulates the format properties for chart error bars.
FormatLoadOptions
Excel.Interfaces.ChartErrorBars An interface for updating data on the ChartErrorBarsFormat
FormatUpdateData object, for use in chartErrorBarsFormat.set({ ... }) .
Excel.Interfaces.ChartErrorBars This object represents the attributes for a chart's error bars.
LoadOptions
Excel.Interfaces.ChartErrorBars An interface for updating data on the ChartErrorBars object, for
UpdateData use in chartErrorBars.set({ ... }) .
Excel.Interfaces.ChartFontData An interface describing the data returned by calling
chartFont.toJSON() .
Excel.Interfaces.ChartFontLoad This object represents the font attributes (such as font name,
Options font size, and color) for a chart object.
Excel.Interfaces.ChartFont An interface for updating data on the ChartFont object, for use in
UpdateData chartFont.set({ ... }) .
Excel.Interfaces.ChartFormat An interface describing the data returned by calling
StringData chartFormatString.toJSON() .
Excel.Interfaces.ChartFormat Represents the substring in chart related objects that contain
StringLoadOptions text, like a ChartTitle object or ChartAxisTitle object.
Excel.Interfaces.ChartFormat An interface for updating data on the ChartFormatString object,
StringUpdateData for use in chartFormatString.set({ ... }) .
Excel.Interfaces.ChartGridlines An interface describing the data returned by calling
Data chartGridlines.toJSON() .
Excel.Interfaces.ChartGridlines An interface describing the data returned by calling
FormatData chartGridlinesFormat.toJSON() .
Excel.Interfaces.ChartGridlines Encapsulates the format properties for chart gridlines.
FormatLoadOptions
Excel.Interfaces.ChartGridlines An interface for updating data on the ChartGridlinesFormat
FormatUpdateData object, for use in chartGridlinesFormat.set({ ... }) .
Excel.Interfaces.ChartGridlines Represents major or minor gridlines on a chart axis.
LoadOptions
Excel.Interfaces.ChartGridlines An interface for updating data on the ChartGridlines object, for
UpdateData use in chartGridlines.set({ ... }) .
Excel.Interfaces.ChartLegend An interface describing the data returned by calling
Data chartLegend.toJSON() .
Excel.Interfaces.ChartLegend An interface describing the data returned by calling
EntryCollectionData chartLegendEntryCollection.toJSON() .
Excel.Interfaces.ChartLegend Represents a collection of legend entries.
EntryCollectionLoadOptions
Excel.Interfaces.ChartLegend An interface for updating data on the
EntryCollectionUpdateData ChartLegendEntryCollection object, for use in
chartLegendEntryCollection.set({ ... }) .
Excel.Interfaces.ChartLegend An interface describing the data returned by calling
EntryData chartLegendEntry.toJSON() .
Excel.Interfaces.ChartLegend Represents the legend entry in legendEntryCollection .
EntryLoadOptions
Excel.Interfaces.ChartLegend An interface for updating data on the ChartLegendEntry object,
EntryUpdateData for use in chartLegendEntry.set({ ... }) .
Excel.Interfaces.ChartLegend An interface describing the data returned by calling
FormatData chartLegendFormat.toJSON() .
Excel.Interfaces.ChartLegend Encapsulates the format properties of a chart legend.
FormatLoadOptions
Excel.Interfaces.ChartLegend An interface for updating data on the ChartLegendFormat object,
FormatUpdateData for use in chartLegendFormat.set({ ... }) .
Excel.Interfaces.ChartLegend Represents the legend in a chart.
LoadOptions
Excel.Interfaces.ChartLegend An interface for updating data on the ChartLegend object, for
UpdateData use in chartLegend.set({ ... }) .
Excel.Interfaces.ChartLine An interface describing the data returned by calling
FormatData chartLineFormat.toJSON() .
Excel.Interfaces.ChartLine Encapsulates the formatting options for line elements.
FormatLoadOptions
Excel.Interfaces.ChartLine An interface for updating data on the ChartLineFormat object,
FormatUpdateData for use in chartLineFormat.set({ ... }) .
Excel.Interfaces.ChartLoad Represents a chart object in a workbook. To learn more about
Options the chart object model, see Work with charts using the Excel
JavaScript API.
Excel.Interfaces.ChartMap An interface describing the data returned by calling
OptionsData chartMapOptions.toJSON() .
Excel.Interfaces.ChartMap Encapsulates the properties for a region map chart.
OptionsLoadOptions
Excel.Interfaces.ChartMap An interface for updating data on the ChartMapOptions object,
OptionsUpdateData for use in chartMapOptions.set({ ... }) .
Excel.Interfaces.ChartPivot An interface describing the data returned by calling
OptionsData chartPivotOptions.toJSON() .
Excel.Interfaces.ChartPivot Encapsulates the options for the pivot chart.
OptionsLoadOptions
Excel.Interfaces.ChartPivot An interface for updating data on the ChartPivotOptions object,
OptionsUpdateData for use in chartPivotOptions.set({ ... }) .
Excel.Interfaces.ChartPlotArea An interface describing the data returned by calling
Data chartPlotArea.toJSON() .
Excel.Interfaces.ChartPlotArea An interface describing the data returned by calling
FormatData chartPlotAreaFormat.toJSON() .
Excel.Interfaces.ChartPlotArea Represents the format properties for a chart plot area.
FormatLoadOptions
Excel.Interfaces.ChartPlotArea An interface for updating data on the ChartPlotAreaFormat
FormatUpdateData object, for use in chartPlotAreaFormat.set({ ... }) .
Excel.Interfaces.ChartPlotArea This object represents the attributes for a chart plot area.
LoadOptions
Excel.Interfaces.ChartPlotArea An interface for updating data on the ChartPlotArea object, for
UpdateData use in chartPlotArea.set({ ... }) .
Excel.Interfaces.ChartPoint An interface describing the data returned by calling
Data chartPoint.toJSON() .
Excel.Interfaces.ChartPoint An interface describing the data returned by calling
FormatData chartPointFormat.toJSON() .
Excel.Interfaces.ChartPoint Represents the formatting object for chart points.
FormatLoadOptions
Excel.Interfaces.ChartPoint An interface for updating data on the ChartPointFormat object,
FormatUpdateData for use in chartPointFormat.set({ ... }) .
Excel.Interfaces.ChartPoint Represents a point of a series in a chart.
LoadOptions
Excel.Interfaces.ChartPoints An interface describing the data returned by calling
CollectionData chartPointsCollection.toJSON() .
Excel.Interfaces.ChartPoints A collection of all the chart points within a series inside a chart.
CollectionLoadOptions
Excel.Interfaces.ChartPoints An interface for updating data on the ChartPointsCollection
CollectionUpdateData object, for use in chartPointsCollection.set({ ... }) .
Excel.Interfaces.ChartPoint An interface for updating data on the ChartPoint object, for use
UpdateData in chartPoint.set({ ... }) .
Excel.Interfaces.ChartSeries An interface describing the data returned by calling
CollectionData chartSeriesCollection.toJSON() .
Excel.Interfaces.ChartSeries Represents a collection of chart series.
CollectionLoadOptions
Excel.Interfaces.ChartSeries An interface for updating data on the ChartSeriesCollection
CollectionUpdateData object, for use in chartSeriesCollection.set({ ... }) .
Excel.Interfaces.ChartSeries An interface describing the data returned by calling
Data chartSeries.toJSON() .
Excel.Interfaces.ChartSeries An interface describing the data returned by calling
FormatData chartSeriesFormat.toJSON() .
Excel.Interfaces.ChartSeries Encapsulates the format properties for the chart series
FormatLoadOptions
Excel.Interfaces.ChartSeries An interface for updating data on the ChartSeriesFormat object,
FormatUpdateData for use in chartSeriesFormat.set({ ... }) .
Excel.Interfaces.ChartSeries Represents a series in a chart.
LoadOptions
Excel.Interfaces.ChartSeries An interface for updating data on the ChartSeries object, for use
UpdateData in chartSeries.set({ ... }) .
Excel.Interfaces.ChartTitleData An interface describing the data returned by calling
chartTitle.toJSON() .
Excel.Interfaces.ChartTitle An interface describing the data returned by calling
FormatData chartTitleFormat.toJSON() .
Excel.Interfaces.ChartTitle Provides access to the formatting options for a chart title.
FormatLoadOptions
Excel.Interfaces.ChartTitle An interface for updating data on the ChartTitleFormat object,
FormatUpdateData for use in chartTitleFormat.set({ ... }) .
Excel.Interfaces.ChartTitleLoad Represents a chart title object of a chart.
Options
Excel.Interfaces.ChartTitle An interface for updating data on the ChartTitle object, for use in
UpdateData chartTitle.set({ ... }) .
Excel.Interfaces.ChartTrendline An interface describing the data returned by calling
CollectionData chartTrendlineCollection.toJSON() .
Excel.Interfaces.ChartTrendline Represents a collection of chart trendlines.
CollectionLoadOptions
Excel.Interfaces.ChartTrendline An interface for updating data on the ChartTrendlineCollection
CollectionUpdateData object, for use in chartTrendlineCollection.set({ ... }) .
Excel.Interfaces.ChartTrendline An interface describing the data returned by calling
Data chartTrendline.toJSON() .
Excel.Interfaces.ChartTrendline An interface describing the data returned by calling
FormatData chartTrendlineFormat.toJSON() .
Excel.Interfaces.ChartTrendline Represents the format properties for the chart trendline.
FormatLoadOptions
Excel.Interfaces.ChartTrendline An interface for updating data on the ChartTrendlineFormat
FormatUpdateData object, for use in chartTrendlineFormat.set({ ... }) .
Excel.Interfaces.ChartTrendline An interface describing the data returned by calling
LabelData chartTrendlineLabel.toJSON() .
Excel.Interfaces.ChartTrendline An interface describing the data returned by calling
LabelFormatData chartTrendlineLabelFormat.toJSON() .
Excel.Interfaces.ChartTrendline Encapsulates the format properties for the chart trendline label.
LabelFormatLoadOptions
Excel.Interfaces.ChartTrendline An interface for updating data on the ChartTrendlineLabelFormat
LabelFormatUpdateData object, for use in chartTrendlineLabelFormat.set({ ... }) .
Excel.Interfaces.ChartTrendline This object represents the attributes for a chart trendline label
LabelLoadOptions object.
Excel.Interfaces.ChartTrendline An interface for updating data on the ChartTrendlineLabel object,
LabelUpdateData for use in chartTrendlineLabel.set({ ... }) .
Excel.Interfaces.ChartTrendline This object represents the attributes for a chart trendline object.
LoadOptions
Excel.Interfaces.ChartTrendline An interface for updating data on the ChartTrendline object, for
UpdateData use in chartTrendline.set({ ... }) .
Excel.Interfaces.ChartUpdate An interface for updating data on the Chart object, for use in
Data chart.set({ ... }) .
Excel.Interfaces.Collection Provides ways to load properties of only a subset of members of
LoadOptions a collection.
Excel.Interfaces.ColorScale An interface describing the data returned by calling
ConditionalFormatData colorScaleConditionalFormat.toJSON() .
Excel.Interfaces.ColorScale Represents the color scale criteria for conditional formatting.
ConditionalFormatLoad
Options
Excel.Interfaces.ColorScale An interface for updating data on the
ConditionalFormatUpdate ColorScaleConditionalFormat object, for use in
Data colorScaleConditionalFormat.set({ ... }) .
Excel.Interfaces.Comment An interface describing the data returned by calling
CollectionData commentCollection.toJSON() .
Excel.Interfaces.Comment Represents a collection of comment objects that are part of the
CollectionLoadOptions workbook.
Excel.Interfaces.Comment An interface for updating data on the CommentCollection object,
CollectionUpdateData for use in commentCollection.set({ ... }) .
Excel.Interfaces.CommentData An interface describing the data returned by calling
comment.toJSON() .
Excel.Interfaces.CommentLoad Represents a comment in the workbook.
Options
Excel.Interfaces.Comment An interface describing the data returned by calling
ReplyCollectionData commentReplyCollection.toJSON() .
Excel.Interfaces.Comment Represents a collection of comment reply objects that are part of
ReplyCollectionLoadOptions the comment.
Excel.Interfaces.Comment An interface for updating data on the CommentReplyCollection
ReplyCollectionUpdateData object, for use in commentReplyCollection.set({ ... }) .
Excel.Interfaces.Comment An interface describing the data returned by calling
ReplyData commentReply.toJSON() .
Excel.Interfaces.Comment Represents a comment reply in the workbook.
ReplyLoadOptions
Excel.Interfaces.Comment An interface for updating data on the CommentReply object, for
ReplyUpdateData use in commentReply.set({ ... }) .
Excel.Interfaces.Comment An interface for updating data on the Comment object, for use in
UpdateData comment.set({ ... }) .
Excel.Interfaces.Conditional An interface describing the data returned by calling
DataBarNegativeFormatData conditionalDataBarNegativeFormat.toJSON() .
Excel.Interfaces.Conditional Represents a conditional format for the negative side of the data
DataBarNegativeFormatLoad bar.
Options
Excel.Interfaces.Conditional An interface for updating data on the
DataBarNegativeFormat ConditionalDataBarNegativeFormat object, for use in
UpdateData conditionalDataBarNegativeFormat.set({ ... }) .
Excel.Interfaces.Conditional An interface describing the data returned by calling
DataBarPositiveFormatData conditionalDataBarPositiveFormat.toJSON() .
Excel.Interfaces.Conditional Represents a conditional format for the positive side of the data
DataBarPositiveFormatLoad bar.
Options
Excel.Interfaces.Conditional An interface for updating data on the
DataBarPositiveFormatUpdate ConditionalDataBarPositiveFormat object, for use in
Data conditionalDataBarPositiveFormat.set({ ... }) .
Excel.Interfaces.Conditional An interface describing the data returned by calling
FormatCollectionData conditionalFormatCollection.toJSON() .
Excel.Interfaces.Conditional Represents a collection of all the conditional formats that are
FormatCollectionLoadOptions overlap the range.
Excel.Interfaces.Conditional An interface for updating data on the
FormatCollectionUpdateData ConditionalFormatCollection object, for use in
conditionalFormatCollection.set({ ... }) .
Excel.Interfaces.Conditional An interface describing the data returned by calling
FormatData conditionalFormat.toJSON() .
Excel.Interfaces.Conditional An object encapsulating a conditional format's range, format,
FormatLoadOptions rule, and other properties. To learn more about the conditional
formatting object model, read Apply conditional formatting to
Excel ranges.
Excel.Interfaces.Conditional An interface describing the data returned by calling
FormatRuleData conditionalFormatRule.toJSON() .
Excel.Interfaces.Conditional Represents a rule, for all traditional rule/format pairings.
FormatRuleLoadOptions
Excel.Interfaces.Conditional An interface for updating data on the ConditionalFormatRule
FormatRuleUpdateData object, for use in conditionalFormatRule.set({ ... }) .
Excel.Interfaces.Conditional An interface for updating data on the ConditionalFormat object,
FormatUpdateData for use in conditionalFormat.set({ ... }) .
Excel.Interfaces.Conditional An interface describing the data returned by calling
RangeBorderCollectionData conditionalRangeBorderCollection.toJSON() .
Excel.Interfaces.Conditional Represents the border objects that make up range border.
RangeBorderCollectionLoad
Options
Excel.Interfaces.Conditional An interface for updating data on the
RangeBorderCollectionUpdate ConditionalRangeBorderCollection object, for use in
Data conditionalRangeBorderCollection.set({ ... }) .
Excel.Interfaces.Conditional An interface describing the data returned by calling
RangeBorderData conditionalRangeBorder.toJSON() .
Excel.Interfaces.Conditional Represents the border of an object.
RangeBorderLoadOptions
Excel.Interfaces.Conditional An interface for updating data on the ConditionalRangeBorder
RangeBorderUpdateData object, for use in conditionalRangeBorder.set({ ... }) .
Excel.Interfaces.Conditional An interface describing the data returned by calling
RangeFillData conditionalRangeFill.toJSON() .
Excel.Interfaces.Conditional Represents the background of a conditional range object.
RangeFillLoadOptions
Excel.Interfaces.Conditional An interface for updating data on the ConditionalRangeFill
RangeFillUpdateData object, for use in conditionalRangeFill.set({ ... }) .
Excel.Interfaces.Conditional An interface describing the data returned by calling
RangeFontData conditionalRangeFont.toJSON() .
Excel.Interfaces.Conditional This object represents the font attributes (font style, color, etc.)
RangeFontLoadOptions for an object.
Excel.Interfaces.Conditional An interface for updating data on the ConditionalRangeFont
RangeFontUpdateData object, for use in conditionalRangeFont.set({ ... }) .
Excel.Interfaces.Conditional An interface describing the data returned by calling
RangeFormatData conditionalRangeFormat.toJSON() .
Excel.Interfaces.Conditional A format object encapsulating the conditional formats range's
RangeFormatLoadOptions font, fill, borders, and other properties.
Excel.Interfaces.Conditional An interface for updating data on the ConditionalRangeFormat
RangeFormatUpdateData object, for use in conditionalRangeFormat.set({ ... }) .
Excel.Interfaces.CultureInfo An interface describing the data returned by calling
Data cultureInfo.toJSON() .
Excel.Interfaces.CultureInfo Provides information based on current system culture settings.
LoadOptions This includes the culture names, number formatting, and other
culturally dependent settings.
Excel.Interfaces.Custom An interface describing the data returned by calling
ConditionalFormatData customConditionalFormat.toJSON() .
Excel.Interfaces.Custom Represents a custom conditional format type.
ConditionalFormatLoad
Options
Excel.Interfaces.Custom An interface for updating data on the CustomConditionalFormat
ConditionalFormatUpdate object, for use in customConditionalFormat.set({ ... }) .
Data
Excel.Interfaces.Custom An interface describing the data returned by calling
PropertyCollectionData customPropertyCollection.toJSON() .
Excel.Interfaces.Custom Contains the collection of custom properties.
PropertyCollectionLoad
Options
Excel.Interfaces.Custom An interface for updating data on the CustomPropertyCollection
PropertyCollectionUpdate object, for use in customPropertyCollection.set({ ... }) .
Data
Excel.Interfaces.Custom An interface describing the data returned by calling
PropertyData customProperty.toJSON() .
Excel.Interfaces.Custom Represents a custom property.
PropertyLoadOptions
Excel.Interfaces.Custom An interface for updating data on the CustomProperty object, for
PropertyUpdateData use in customProperty.set({ ... }) .
Excel.Interfaces.CustomXml An interface describing the data returned by calling
PartCollectionData customXmlPartCollection.toJSON() .
Excel.Interfaces.CustomXml A collection of custom XML parts.
PartCollectionLoadOptions
Excel.Interfaces.CustomXml An interface for updating data on the CustomXmlPartCollection
PartCollectionUpdateData object, for use in customXmlPartCollection.set({ ... }) .
Excel.Interfaces.CustomXml An interface describing the data returned by calling
PartData customXmlPart.toJSON() .
Excel.Interfaces.CustomXml Represents a custom XML part object in a workbook.
PartLoadOptions
Excel.Interfaces.CustomXml An interface describing the data returned by calling
PartScopedCollectionData customXmlPartScopedCollection.toJSON() .
Excel.Interfaces.CustomXml A scoped collection of custom XML parts. A scoped collection is
PartScopedCollectionLoad the result of some operation (e.g., filtering by namespace). A
Options scoped collection cannot be scoped any further.
Excel.Interfaces.CustomXml An interface for updating data on the
PartScopedCollectionUpdate CustomXmlPartScopedCollection object, for use in
Data customXmlPartScopedCollection.set({ ... }) .
Excel.Interfaces.DataBar An interface describing the data returned by calling
ConditionalFormatData dataBarConditionalFormat.toJSON() .
Excel.Interfaces.DataBar Represents an Excel conditional data bar type.
ConditionalFormatLoad
Options
Excel.Interfaces.DataBar An interface for updating data on the DataBarConditionalFormat
ConditionalFormatUpdate object, for use in dataBarConditionalFormat.set({ ... }) .
Data
Excel.Interfaces.DataPivot An interface describing the data returned by calling
HierarchyCollectionData dataPivotHierarchyCollection.toJSON() .
Excel.Interfaces.DataPivot Represents a collection of DataPivotHierarchy items associated
HierarchyCollectionLoad with the PivotTable.
Options
Excel.Interfaces.DataPivot An interface for updating data on the
HierarchyCollectionUpdate DataPivotHierarchyCollection object, for use in
Data dataPivotHierarchyCollection.set({ ... }) .
Excel.Interfaces.DataPivot An interface describing the data returned by calling
HierarchyData dataPivotHierarchy.toJSON() .
Excel.Interfaces.DataPivot Represents the Excel DataPivotHierarchy.
HierarchyLoadOptions
Excel.Interfaces.DataPivot An interface for updating data on the DataPivotHierarchy object,
HierarchyUpdateData for use in dataPivotHierarchy.set({ ... }) .
Excel.Interfaces.DataValidation An interface describing the data returned by calling
Data dataValidation.toJSON() .
Excel.Interfaces.DataValidation Represents the data validation applied to the current range. To
LoadOptions learn more about the data validation object model, read Add
data validation to Excel ranges.
Excel.Interfaces.DataValidation An interface for updating data on the DataValidation object, for
UpdateData use in dataValidation.set({ ... }) .
Excel.Interfaces.Datetime An interface describing the data returned by calling
FormatInfoData datetimeFormatInfo.toJSON() .
Excel.Interfaces.Datetime Defines the culturally appropriate format of displaying numbers.
FormatInfoLoadOptions This is based on current system culture settings.
Excel.Interfaces.Document An interface describing the data returned by calling
PropertiesData documentProperties.toJSON() .
Excel.Interfaces.Document Represents workbook properties.
PropertiesLoadOptions
Excel.Interfaces.Document An interface for updating data on the DocumentProperties
PropertiesUpdateData object, for use in documentProperties.set({ ... }) .
Excel.Interfaces.DocumentTask An interface describing the data returned by calling
ChangeCollectionData documentTaskChangeCollection.toJSON() .
Excel.Interfaces.DocumentTask Represents a collection of change records for a task.
ChangeCollectionLoad
Options
Excel.Interfaces.DocumentTask An interface for updating data on the
ChangeCollectionUpdateData DocumentTaskChangeCollection object, for use in
documentTaskChangeCollection.set({ ... }) .
Excel.Interfaces.DocumentTask An interface describing the data returned by calling
ChangeData documentTaskChange.toJSON() .
Excel.Interfaces.DocumentTask Represents a recorded change to the task.
ChangeLoadOptions
Excel.Interfaces.DocumentTask An interface describing the data returned by calling
CollectionData documentTaskCollection.toJSON() .
Excel.Interfaces.DocumentTask Represents a collection of tasks.
CollectionLoadOptions
Excel.Interfaces.DocumentTask An interface for updating data on the DocumentTaskCollection
CollectionUpdateData object, for use in documentTaskCollection.set({ ... }) .
Excel.Interfaces.DocumentTask An interface describing the data returned by calling
Data documentTask.toJSON() .
Excel.Interfaces.DocumentTask Represents a task.
LoadOptions
Excel.Interfaces.DocumentTask An interface for updating data on the DocumentTask object, for
UpdateData use in documentTask.set({ ... }) .
Excel.Interfaces.FilterData An interface describing the data returned by calling
filter.toJSON() .
Excel.Interfaces.FilterLoad Manages the filtering of a table's column.
Options
Excel.Interfaces.FilterPivot An interface describing the data returned by calling
HierarchyCollectionData filterPivotHierarchyCollection.toJSON() .
Excel.Interfaces.FilterPivot Represents a collection of FilterPivotHierarchy items associated
HierarchyCollectionLoad with the PivotTable.
Options
Excel.Interfaces.FilterPivot An interface for updating data on the
HierarchyCollectionUpdate FilterPivotHierarchyCollection object, for use in
Data filterPivotHierarchyCollection.set({ ... }) .
Excel.Interfaces.FilterPivot An interface describing the data returned by calling
HierarchyData filterPivotHierarchy.toJSON() .
Excel.Interfaces.FilterPivot Represents the Excel FilterPivotHierarchy.
HierarchyLoadOptions
Excel.Interfaces.FilterPivot An interface for updating data on the FilterPivotHierarchy object,
HierarchyUpdateData for use in filterPivotHierarchy.set({ ... }) .
Excel.Interfaces.Format An interface describing the data returned by calling
ProtectionData formatProtection.toJSON() .
Excel.Interfaces.Format Represents the format protection of a range object.
ProtectionLoadOptions
Excel.Interfaces.Format An interface for updating data on the FormatProtection object,
ProtectionUpdateData for use in formatProtection.set({ ... }) .
Excel.Interfaces.FunctionResult An interface describing the data returned by calling
Data functionResult.toJSON() .
Excel.Interfaces.FunctionResult An object containing the result of a function-evaluation
LoadOptions operation
Excel.Interfaces.Geometric An interface describing the data returned by calling
ShapeData geometricShape.toJSON() .
Excel.Interfaces.Geometric Represents a geometric shape inside a worksheet. A geometric
ShapeLoadOptions shape can be a rectangle, block arrow, equation symbol,
flowchart item, star, banner, callout, or any other basic shape in
Excel.
Excel.Interfaces.GroupShape An interface describing the data returned by calling
CollectionData groupShapeCollection.toJSON() .
Excel.Interfaces.GroupShape Represents the shape collection inside a shape group.
CollectionLoadOptions
Excel.Interfaces.GroupShape An interface for updating data on the GroupShapeCollection
CollectionUpdateData object, for use in groupShapeCollection.set({ ... }) .
Excel.Interfaces.HeaderFooter An interface describing the data returned by calling
Data headerFooter.toJSON() .
Excel.Interfaces.HeaderFooter An interface describing the data returned by calling
GroupData headerFooterGroup.toJSON() .
Excel.Interfaces.HeaderFooterGroupLoadOptions
Excel.Interfaces.HeaderFooter An interface for updating data on the HeaderFooterGroup
GroupUpdateData object, for use in headerFooterGroup.set({ ... }) .
Excel.Interfaces.HeaderFooterLoadOptions
Excel.Interfaces.HeaderFooter An interface for updating data on the HeaderFooter object, for
UpdateData use in headerFooter.set({ ... }) .
Excel.Interfaces.IconSet An interface describing the data returned by calling
ConditionalFormatData iconSetConditionalFormat.toJSON() .
Excel.Interfaces.IconSet Represents an icon set criteria for conditional formatting.
ConditionalFormatLoad
Options
Excel.Interfaces.IconSet An interface for updating data on the IconSetConditionalFormat
ConditionalFormatUpdate object, for use in iconSetConditionalFormat.set({ ... }) .
Data
Excel.Interfaces.ImageData An interface describing the data returned by calling
image.toJSON() .
Excel.Interfaces.ImageLoad Represents an image in the worksheet. To get the corresponding
Options Shape object, use Image.shape .
Excel.Interfaces.Iterative An interface describing the data returned by calling
CalculationData iterativeCalculation.toJSON() .
Excel.Interfaces.Iterative Represents the iterative calculation settings.
CalculationLoadOptions
Excel.Interfaces.Iterative An interface for updating data on the IterativeCalculation object,
CalculationUpdateData for use in iterativeCalculation.set({ ... }) .
Excel.Interfaces.LineData An interface describing the data returned by calling
line.toJSON() .
Excel.Interfaces.LineLoad Represents a line inside a worksheet. To get the corresponding
Options Shape object, use Line.shape .
Excel.Interfaces.LineUpdate An interface for updating data on the Line object, for use in
Data line.set({ ... }) .
Excel.Interfaces.LinkedData An interface describing the data returned by calling
TypeCollectionData linkedDataTypeCollection.toJSON() .
Excel.Interfaces.LinkedData Represents a collection of linked data types.
TypeCollectionLoadOptions
Excel.Interfaces.LinkedData An interface for updating data on the LinkedDataTypeCollection
TypeCollectionUpdateData object, for use in linkedDataTypeCollection.set({ ... }) .
Excel.Interfaces.LinkedData An interface describing the data returned by calling
TypeData linkedDataType.toJSON() .
Excel.Interfaces.LinkedData Represents a linked data type. A linked data type is a data type
TypeLoadOptions connected to an online data source.
Excel.Interfaces.Linked An interface describing the data returned by calling
WorkbookCollectionData linkedWorkbookCollection.toJSON() .
Excel.Interfaces.Linked Represents a collection of linked workbook objects.
WorkbookCollectionLoad
Options
Excel.Interfaces.Linked An interface for updating data on the LinkedWorkbookCollection
WorkbookCollectionUpdate object, for use in linkedWorkbookCollection.set({ ... }) .
Data
Excel.Interfaces.Linked An interface describing the data returned by calling
WorkbookData linkedWorkbook.toJSON() .
Excel.Interfaces.Linked Contains information about a linked workbook. If a workbook
WorkbookLoadOptions has links pointing to data in another workbook, the second
workbook is linked to the first workbook. In this scenario, the
second workbook is called the "linked workbook".
Excel.Interfaces.NamedItem An interface describing the data returned by calling
ArrayValuesData namedItemArrayValues.toJSON() .
Excel.Interfaces.NamedItem Represents an object containing values and types of a named
ArrayValuesLoadOptions item.
Excel.Interfaces.NamedItem An interface describing the data returned by calling
CollectionData namedItemCollection.toJSON() .
Excel.Interfaces.NamedItem A collection of all the NamedItem objects that are part of the
CollectionLoadOptions workbook or worksheet, depending on how it was reached.
Excel.Interfaces.NamedItem An interface for updating data on the NamedItemCollection
CollectionUpdateData object, for use in namedItemCollection.set({ ... }) .
Excel.Interfaces.NamedItem An interface describing the data returned by calling
Data namedItem.toJSON() .
Excel.Interfaces.NamedItem Represents a defined name for a range of cells or value. Names
LoadOptions can be primitive named objects (as seen in the type below),
range object, or a reference to a range. This object can be used
to obtain range object associated with names.
Excel.Interfaces.NamedItem An interface for updating data on the NamedItem object, for use
UpdateData in namedItem.set({ ... }) .
Excel.Interfaces.NamedSheet An interface describing the data returned by calling
ViewCollectionData namedSheetViewCollection.toJSON() .
Excel.Interfaces.NamedSheet Represents the collection of sheet views in the worksheet.
ViewCollectionLoadOptions
Excel.Interfaces.NamedSheet An interface for updating data on the
ViewCollectionUpdateData NamedSheetViewCollection object, for use in
namedSheetViewCollection.set({ ... }) .
Excel.Interfaces.NamedSheet An interface describing the data returned by calling
ViewData namedSheetView.toJSON() .
Excel.Interfaces.NamedSheet Represents a named sheet view of a worksheet. A sheet view
ViewLoadOptions stores the sort and filter rules for a particular worksheet. Every
sheet view (even a temporary sheet view) has a unique,
worksheet-scoped name that is used to access the view.
Excel.Interfaces.NamedSheet An interface for updating data on the NamedSheetView object,
ViewUpdateData for use in namedSheetView.set({ ... }) .
Excel.Interfaces.Number An interface describing the data returned by calling
FormatInfoData numberFormatInfo.toJSON() .
Excel.Interfaces.Number Defines the culturally appropriate format of displaying numbers.
FormatInfoLoadOptions This is based on current system culture settings.
Excel.Interfaces.PageBreak An interface describing the data returned by calling
CollectionData pageBreakCollection.toJSON() .
Excel.Interfaces.PageBreakCollectionLoadOptions
Excel.Interfaces.PageBreak An interface for updating data on the PageBreakCollection
CollectionUpdateData object, for use in pageBreakCollection.set({ ... }) .
Excel.Interfaces.PageBreak An interface describing the data returned by calling
Data pageBreak.toJSON() .
Excel.Interfaces.PageBreakLoadOptions
Excel.Interfaces.PageLayout An interface describing the data returned by calling
Data pageLayout.toJSON() .
Excel.Interfaces.PageLayout Represents layout and print settings that are not dependent on
LoadOptions any printer-specific implementation. These settings include
margins, orientation, page numbering, title rows, and print area.
Excel.Interfaces.PageLayout An interface for updating data on the PageLayout object, for use
UpdateData in pageLayout.set({ ... }) .
Excel.Interfaces.PivotField An interface describing the data returned by calling
CollectionData pivotFieldCollection.toJSON() .
Excel.Interfaces.PivotField Represents a collection of all the PivotFields that are part of a
CollectionLoadOptions PivotTable's hierarchy.
Excel.Interfaces.PivotField An interface for updating data on the PivotFieldCollection object,
CollectionUpdateData for use in pivotFieldCollection.set({ ... }) .
Excel.Interfaces.PivotFieldData An interface describing the data returned by calling
pivotField.toJSON() .
Excel.Interfaces.PivotFieldLoad Represents the Excel PivotField.
Options
Excel.Interfaces.PivotField An interface for updating data on the PivotField object, for use in
UpdateData pivotField.set({ ... }) .
Excel.Interfaces.PivotHierarchy An interface describing the data returned by calling
CollectionData pivotHierarchyCollection.toJSON() .
Excel.Interfaces.PivotHierarchy Represents a collection of all the PivotHierarchies that are part of
CollectionLoadOptions the PivotTable.
Excel.Interfaces.PivotHierarchy An interface for updating data on the PivotHierarchyCollection
CollectionUpdateData object, for use in pivotHierarchyCollection.set({ ... }) .
Excel.Interfaces.PivotHierarchy An interface describing the data returned by calling
Data pivotHierarchy.toJSON() .
Excel.Interfaces.PivotHierarchy Represents the Excel PivotHierarchy.
LoadOptions
Excel.Interfaces.PivotHierarchy An interface for updating data on the PivotHierarchy object, for
UpdateData use in pivotHierarchy.set({ ... }) .
Excel.Interfaces.PivotItem An interface describing the data returned by calling
CollectionData pivotItemCollection.toJSON() .
Excel.Interfaces.PivotItem Represents a collection of all the PivotItems related to their
CollectionLoadOptions parent PivotField.
Excel.Interfaces.PivotItem An interface for updating data on the PivotItemCollection object,
CollectionUpdateData for use in pivotItemCollection.set({ ... }) .
Excel.Interfaces.PivotItemData An interface describing the data returned by calling
pivotItem.toJSON() .
Excel.Interfaces.PivotItemLoad Represents the Excel PivotItem.
Options
Excel.Interfaces.PivotItem An interface for updating data on the PivotItem object, for use in
UpdateData pivotItem.set({ ... }) .
Excel.Interfaces.PivotLayout An interface describing the data returned by calling
Data pivotLayout.toJSON() .
Excel.Interfaces.PivotLayout Represents the visual layout of the PivotTable.
LoadOptions
Excel.Interfaces.PivotLayout An interface for updating data on the PivotLayout object, for use
UpdateData in pivotLayout.set({ ... }) .
Excel.Interfaces.PivotTable An interface describing the data returned by calling
CollectionData pivotTableCollection.toJSON() .
Excel.Interfaces.PivotTable Represents a collection of all the PivotTables that are part of the
CollectionLoadOptions workbook or worksheet.
Excel.Interfaces.PivotTable An interface for updating data on the PivotTableCollection
CollectionUpdateData object, for use in pivotTableCollection.set({ ... }) .
Excel.Interfaces.PivotTable An interface describing the data returned by calling
Data pivotTable.toJSON() .
Excel.Interfaces.PivotTable Represents an Excel PivotTable. To learn more about the
LoadOptions PivotTable object model, read Work with PivotTables using the
Excel JavaScript API.
Excel.Interfaces.PivotTable An interface describing the data returned by calling
ScopedCollectionData pivotTableScopedCollection.toJSON() .
Excel.Interfaces.PivotTable Represents a scoped collection of PivotTables. The PivotTables
ScopedCollectionLoadOptions are sorted based on the location of the PivotTable's top-left
corner. They are ordered top-to-bottom and then left-to-right.
Excel.Interfaces.PivotTable An interface for updating data on the
ScopedCollectionUpdateData PivotTableScopedCollection object, for use in
pivotTableScopedCollection.set({ ... }) .
Excel.Interfaces.PivotTable An interface describing the data returned by calling
StyleCollectionData pivotTableStyleCollection.toJSON() .
Excel.Interfaces.PivotTable Represents a collection of PivotTable styles.
StyleCollectionLoadOptions
Excel.Interfaces.PivotTable An interface for updating data on the PivotTableStyleCollection
StyleCollectionUpdateData object, for use in pivotTableStyleCollection.set({ ... }) .
Excel.Interfaces.PivotTable An interface describing the data returned by calling
StyleData pivotTableStyle.toJSON() .
Excel.Interfaces.PivotTable Represents a PivotTable style, which defines style elements by
StyleLoadOptions PivotTable region.
Excel.Interfaces.PivotTable An interface for updating data on the PivotTableStyle object, for
StyleUpdateData use in pivotTableStyle.set({ ... }) .
Excel.Interfaces.PivotTable An interface for updating data on the PivotTable object, for use
UpdateData in pivotTable.set({ ... }) .
Excel.Interfaces.PresetCriteria An interface describing the data returned by calling
ConditionalFormatData presetCriteriaConditionalFormat.toJSON() .
Excel.Interfaces.PresetCriteria Represents the preset criteria conditional format such as above
ConditionalFormatLoad average, below average, unique values, contains blank, nonblank,
Options error, and noerror.
Excel.Interfaces.PresetCriteria An interface for updating data on the
ConditionalFormatUpdate PresetCriteriaConditionalFormat object, for use in
Data presetCriteriaConditionalFormat.set({ ... }) .
Excel.Interfaces.Query An interface describing the data returned by calling
CollectionData queryCollection.toJSON() .
Excel.Interfaces.Query Represents the collection of queries in the workbook.
CollectionLoadOptions
Excel.Interfaces.Query An interface for updating data on the QueryCollection object, for
CollectionUpdateData use in queryCollection.set({ ... }) .
Excel.Interfaces.QueryData An interface describing the data returned by calling
query.toJSON() .
Excel.Interfaces.QueryLoad Represents a Power Query query.
Options
Excel.Interfaces.RangeAreas An interface describing the data returned by calling
CollectionData rangeAreasCollection.toJSON() .
Excel.Interfaces.RangeAreas Contains the collection of cross-workbook level ranges.
CollectionLoadOptions
Excel.Interfaces.RangeAreas An interface for updating data on the RangeAreasCollection
CollectionUpdateData object, for use in rangeAreasCollection.set({ ... }) .
Excel.Interfaces.RangeAreas An interface describing the data returned by calling
Data rangeAreas.toJSON() .
Excel.Interfaces.RangeAreas RangeAreas represents a collection of one or more rectangular
LoadOptions ranges in the same worksheet. To learn how to use discontiguous
ranges, read Work with multiple ranges simultaneously in Excel
add-ins.
Excel.Interfaces.RangeAreas An interface for updating data on the RangeAreas object, for use
UpdateData in rangeAreas.set({ ... }) .
Excel.Interfaces.RangeBorder An interface describing the data returned by calling
CollectionData rangeBorderCollection.toJSON() .
Excel.Interfaces.RangeBorder Represents the border objects that make up the range border.
CollectionLoadOptions
Excel.Interfaces.RangeBorder An interface for updating data on the RangeBorderCollection
CollectionUpdateData object, for use in rangeBorderCollection.set({ ... }) .
Excel.Interfaces.RangeBorder An interface describing the data returned by calling
Data rangeBorder.toJSON() .
Excel.Interfaces.RangeBorder Represents the border of an object.
LoadOptions
Excel.Interfaces.RangeBorder An interface for updating data on the RangeBorder object, for
UpdateData use in rangeBorder.set({ ... }) .
Excel.Interfaces.Range An interface describing the data returned by calling
CollectionData rangeCollection.toJSON() .
Excel.Interfaces.RangeCollectionLoadOptions
Excel.Interfaces.Range An interface for updating data on the RangeCollection object, for
CollectionUpdateData use in rangeCollection.set({ ... }) .
Excel.Interfaces.RangeData An interface describing the data returned by calling
range.toJSON() .
Excel.Interfaces.RangeFillData An interface describing the data returned by calling
rangeFill.toJSON() .
Excel.Interfaces.RangeFillLoad Represents the background of a range object.
Options
Excel.Interfaces.RangeFill An interface for updating data on the RangeFill object, for use in
UpdateData rangeFill.set({ ... }) .
Excel.Interfaces.RangeFont An interface describing the data returned by calling
Data rangeFont.toJSON() .
Excel.Interfaces.RangeFont This object represents the font attributes (font name, font size,
LoadOptions color, etc.) for an object.
Excel.Interfaces.RangeFont An interface for updating data on the RangeFont object, for use
UpdateData in rangeFont.set({ ... }) .
Excel.Interfaces.RangeFormat An interface describing the data returned by calling
Data rangeFormat.toJSON() .
Excel.Interfaces.RangeFormat A format object encapsulating the range's font, fill, borders,
LoadOptions alignment, and other properties.
Excel.Interfaces.RangeFormat An interface for updating data on the RangeFormat object, for
UpdateData use in rangeFormat.set({ ... }) .
Excel.Interfaces.RangeLoad Range represents a set of one or more contiguous cells such as a
Options cell, a row, a column, or a block of cells. To learn more about
how ranges are used throughout the API, start with Ranges in
the Excel JavaScript API.
Excel.Interfaces.RangeUpdate An interface for updating data on the Range object, for use in
Data range.set({ ... }) .
Excel.Interfaces.RangeView An interface describing the data returned by calling
CollectionData rangeViewCollection.toJSON() .
Excel.Interfaces.RangeView Represents a collection of RangeView objects.
CollectionLoadOptions
Excel.Interfaces.RangeView An interface for updating data on the RangeViewCollection
CollectionUpdateData object, for use in rangeViewCollection.set({ ... }) .
Excel.Interfaces.RangeView An interface describing the data returned by calling
Data rangeView.toJSON() .
Excel.Interfaces.RangeView RangeView represents a set of visible cells of the parent range.
LoadOptions
Excel.Interfaces.RangeView An interface for updating data on the RangeView object, for use
UpdateData in rangeView.set({ ... }) .
Excel.Interfaces.Remove An interface describing the data returned by calling
DuplicatesResultData removeDuplicatesResult.toJSON() .
Excel.Interfaces.Remove Represents the results from Range.removeDuplicates .
DuplicatesResultLoadOptions
Excel.Interfaces.RowColumn An interface describing the data returned by calling
PivotHierarchyCollectionData rowColumnPivotHierarchyCollection.toJSON() .
Excel.Interfaces.RowColumn Represents a collection of RowColumnPivotHierarchy items
PivotHierarchyCollectionLoad associated with the PivotTable.
Options
Excel.Interfaces.RowColumn An interface for updating data on the
PivotHierarchyCollection RowColumnPivotHierarchyCollection object, for use in
UpdateData rowColumnPivotHierarchyCollection.set({ ... }) .
Excel.Interfaces.RowColumn An interface describing the data returned by calling
PivotHierarchyData rowColumnPivotHierarchy.toJSON() .
Excel.Interfaces.RowColumn Represents the Excel RowColumnPivotHierarchy.
PivotHierarchyLoadOptions
Excel.Interfaces.RowColumn An interface for updating data on the RowColumnPivotHierarchy
PivotHierarchyUpdateData object, for use in rowColumnPivotHierarchy.set({ ... }) .
Excel.Interfaces.RuntimeData An interface describing the data returned by calling
runtime.toJSON() .
Excel.Interfaces.RuntimeLoad Represents the Excel Runtime class.
Options
Excel.Interfaces.Runtime An interface for updating data on the Runtime object, for use in
UpdateData runtime.set({ ... }) .
Excel.Interfaces.Setting An interface describing the data returned by calling
CollectionData settingCollection.toJSON() .
Excel.Interfaces.Setting Represents a collection of key-value pair setting objects that are
CollectionLoadOptions part of the workbook. The scope is limited to per file and add-in
(task-pane or content) combination.
Excel.Interfaces.Setting An interface for updating data on the SettingCollection object,
CollectionUpdateData for use in settingCollection.set({ ... }) .
Excel.Interfaces.SettingData An interface describing the data returned by calling
setting.toJSON() .
Excel.Interfaces.SettingLoad Setting represents a key-value pair of a setting persisted to the
Options document (per file, per add-in). These custom key-value pair can
be used to store state or lifecycle information needed by the
content or task-pane add-in. Note that settings are persisted in
the document and hence it is not a place to store any sensitive
or protected information such as user information and password.
Excel.Interfaces.SettingUpdate An interface for updating data on the Setting object, for use in
Data setting.set({ ... }) .
Excel.Interfaces.Shape An interface describing the data returned by calling
CollectionData shapeCollection.toJSON() .
Excel.Interfaces.Shape Represents a collection of all the shapes in the worksheet.
CollectionLoadOptions
Excel.Interfaces.Shape An interface for updating data on the ShapeCollection object, for
CollectionUpdateData use in shapeCollection.set({ ... }) .
Excel.Interfaces.ShapeData An interface describing the data returned by calling
shape.toJSON() .
Excel.Interfaces.ShapeFillData An interface describing the data returned by calling
shapeFill.toJSON() .
Excel.Interfaces.ShapeFillLoad Represents the fill formatting of a shape object.
Options
Excel.Interfaces.ShapeFill An interface for updating data on the ShapeFill object, for use in
UpdateData shapeFill.set({ ... }) .
Excel.Interfaces.ShapeFont An interface describing the data returned by calling
Data shapeFont.toJSON() .
Excel.Interfaces.ShapeFont Represents the font attributes, such as font name, font size, and
LoadOptions color, for a shape's TextRange object.
Excel.Interfaces.ShapeFont An interface for updating data on the ShapeFont object, for use
UpdateData in shapeFont.set({ ... }) .
Excel.Interfaces.ShapeGroup An interface describing the data returned by calling
Data shapeGroup.toJSON() .
Excel.Interfaces.ShapeGroup Represents a shape group inside a worksheet. To get the
LoadOptions corresponding Shape object, use ShapeGroup.shape .
Excel.Interfaces.ShapeLine An interface describing the data returned by calling
FormatData shapeLineFormat.toJSON() .
Excel.Interfaces.ShapeLine Represents the line formatting for the shape object. For images
FormatLoadOptions and geometric shapes, line formatting represents the border of
the shape.
Excel.Interfaces.ShapeLine An interface for updating data on the ShapeLineFormat object,
FormatUpdateData for use in shapeLineFormat.set({ ... }) .
Excel.Interfaces.ShapeLoad Represents a generic shape object in the worksheet. A shape
Options could be a geometric shape, a line, a group of shapes, etc. To
learn more about the shape object model, read Work with
shapes using the Excel JavaScript API.
Excel.Interfaces.ShapeUpdate An interface for updating data on the Shape object, for use in
Data shape.set({ ... }) .
Excel.Interfaces.Slicer An interface describing the data returned by calling
CollectionData slicerCollection.toJSON() .
Excel.Interfaces.Slicer Represents a collection of all the slicer objects in the workbook
CollectionLoadOptions or a worksheet.
Excel.Interfaces.Slicer An interface for updating data on the SlicerCollection object, for
CollectionUpdateData use in slicerCollection.set({ ... }) .
Excel.Interfaces.SlicerData An interface describing the data returned by calling
slicer.toJSON() .
Excel.Interfaces.SlicerItem An interface describing the data returned by calling
CollectionData slicerItemCollection.toJSON() .
Excel.Interfaces.SlicerItem Represents a collection of all the slicer item objects in the slicer.
CollectionLoadOptions
Excel.Interfaces.SlicerItem An interface for updating data on the SlicerItemCollection object,
CollectionUpdateData for use in slicerItemCollection.set({ ... }) .
Excel.Interfaces.SlicerItemData An interface describing the data returned by calling
slicerItem.toJSON() .
Excel.Interfaces.SlicerItemLoad Represents a slicer item in a slicer.
Options
Excel.Interfaces.SlicerItem An interface for updating data on the SlicerItem object, for use in
UpdateData slicerItem.set({ ... }) .
Excel.Interfaces.SlicerLoad Represents a Slicer object in the workbook.
Options
Excel.Interfaces.SlicerStyle An interface describing the data returned by calling
CollectionData slicerStyleCollection.toJSON() .
Excel.Interfaces.SlicerStyle Represents a collection of SlicerStyle objects.
CollectionLoadOptions
Excel.Interfaces.SlicerStyle An interface for updating data on the SlicerStyleCollection
CollectionUpdateData object, for use in slicerStyleCollection.set({ ... }) .
Excel.Interfaces.SlicerStyleData An interface describing the data returned by calling
slicerStyle.toJSON() .
Excel.Interfaces.SlicerStyle Represents a slicer style, which defines style elements by region
LoadOptions of the slicer.
Excel.Interfaces.SlicerStyle An interface for updating data on the SlicerStyle object, for use
UpdateData in slicerStyle.set({ ... }) .
Excel.Interfaces.SlicerUpdate An interface for updating data on the Slicer object, for use in
Data slicer.set({ ... }) .
Excel.Interfaces.StyleCollection An interface describing the data returned by calling
Data styleCollection.toJSON() .
Excel.Interfaces.StyleCollection Represents a collection of all the styles.
LoadOptions
Excel.Interfaces.StyleCollection An interface for updating data on the StyleCollection object, for
UpdateData use in styleCollection.set({ ... }) .
Excel.Interfaces.StyleData An interface describing the data returned by calling
style.toJSON() .
Excel.Interfaces.StyleLoad An object encapsulating a style's format and other properties.
Options
Excel.Interfaces.StyleUpdate An interface for updating data on the Style object, for use in
Data style.set({ ... }) .
Excel.Interfaces.Table An interface describing the data returned by calling
CollectionData tableCollection.toJSON() .
Excel.Interfaces.Table Represents a collection of all the tables that are part of the
CollectionLoadOptions workbook or worksheet, depending on how it was reached.
Excel.Interfaces.Table An interface for updating data on the TableCollection object, for
CollectionUpdateData use in tableCollection.set({ ... }) .
Excel.Interfaces.TableColumn An interface describing the data returned by calling
CollectionData tableColumnCollection.toJSON() .
Excel.Interfaces.TableColumn Represents a collection of all the columns that are part of the
CollectionLoadOptions table.
Excel.Interfaces.TableColumn An interface for updating data on the TableColumnCollection
CollectionUpdateData object, for use in tableColumnCollection.set({ ... }) .
Excel.Interfaces.TableColumn An interface describing the data returned by calling
Data tableColumn.toJSON() .
Excel.Interfaces.TableColumn Represents a column in a table.
LoadOptions
Excel.Interfaces.TableColumn An interface for updating data on the TableColumn object, for
UpdateData use in tableColumn.set({ ... }) .
Excel.Interfaces.TableData An interface describing the data returned by calling
table.toJSON() .
Excel.Interfaces.TableLoad Represents an Excel table. To learn more about the table object
Options model, read Work with tables using the Excel JavaScript API.
Excel.Interfaces.TableRow An interface describing the data returned by calling
CollectionData tableRowCollection.toJSON() .
Excel.Interfaces.TableRow Represents a collection of all the rows that are part of the table.
CollectionLoadOptions
Note that unlike ranges or columns, which will adjust if new rows
or columns are added before them, a TableRow object represents
the physical location of the table row, but not the data. That is, if
the data is sorted or if new rows are added, a table row will
continue to point at the index for which it was created.
Excel.Interfaces.TableRow An interface for updating data on the TableRowCollection object,
CollectionUpdateData for use in tableRowCollection.set({ ... }) .
Excel.Interfaces.TableRowData An interface describing the data returned by calling
tableRow.toJSON() .
Excel.Interfaces.TableRowLoad Represents a row in a table.
Options
Note that unlike ranges or columns, which will adjust if new rows
or columns are added before them, a TableRow object represents
the physical location of the table row, but not the data. That is, if
the data is sorted or if new rows are added, a table row will
continue to point at the index for which it was created.
Excel.Interfaces.TableRow An interface for updating data on the TableRow object, for use in
UpdateData tableRow.set({ ... }) .
Excel.Interfaces.TableScoped An interface describing the data returned by calling
CollectionData tableScopedCollection.toJSON() .
Excel.Interfaces.TableScoped Represents a scoped collection of tables. For each table its top-
CollectionLoadOptions left corner is considered its anchor location, and the tables are
sorted top-to-bottom and then left-to-right.
Excel.Interfaces.TableScoped An interface for updating data on the TableScopedCollection
CollectionUpdateData object, for use in tableScopedCollection.set({ ... }) .
Excel.Interfaces.TableSortData An interface describing the data returned by calling
tableSort.toJSON() .
Excel.Interfaces.TableSortLoad Manages sorting operations on Table objects.
Options
Excel.Interfaces.TableStyle An interface describing the data returned by calling
CollectionData tableStyleCollection.toJSON() .
Excel.Interfaces.TableStyle Represents a collection of table styles.
CollectionLoadOptions
Excel.Interfaces.TableStyle An interface for updating data on the TableStyleCollection object,
CollectionUpdateData for use in tableStyleCollection.set({ ... }) .
Excel.Interfaces.TableStyleData An interface describing the data returned by calling
tableStyle.toJSON() .
Excel.Interfaces.TableStyleLoad Represents a table style, which defines the style elements by
Options region of the table.
Excel.Interfaces.TableStyle An interface for updating data on the TableStyle object, for use in
UpdateData tableStyle.set({ ... }) .
Excel.Interfaces.TableUpdate An interface for updating data on the Table object, for use in
Data table.set({ ... }) .
Excel.Interfaces.Text An interface describing the data returned by calling
ConditionalFormatData textConditionalFormat.toJSON() .
Excel.Interfaces.Text Represents a specific text conditional format.
ConditionalFormatLoad
Options
Excel.Interfaces.Text An interface for updating data on the TextConditionalFormat
ConditionalFormatUpdate object, for use in textConditionalFormat.set({ ... }) .
Data
Excel.Interfaces.TextFrame An interface describing the data returned by calling
Data textFrame.toJSON() .
Excel.Interfaces.TextFrame Represents the text frame of a shape object.
LoadOptions
Excel.Interfaces.TextFrame An interface for updating data on the TextFrame object, for use
UpdateData in textFrame.set({ ... }) .
Excel.Interfaces.TextRange An interface describing the data returned by calling
Data textRange.toJSON() .
Excel.Interfaces.TextRange Contains the text that is attached to a shape, in addition to
LoadOptions properties and methods for manipulating the text.
Excel.Interfaces.TextRange An interface for updating data on the TextRange object, for use
UpdateData in textRange.set({ ... }) .
Excel.Interfaces.TimelineStyle An interface describing the data returned by calling
CollectionData timelineStyleCollection.toJSON() .
Excel.Interfaces.TimelineStyle Represents a collection of timeline styles.
CollectionLoadOptions
Excel.Interfaces.TimelineStyle An interface for updating data on the TimelineStyleCollection
CollectionUpdateData object, for use in timelineStyleCollection.set({ ... }) .
Excel.Interfaces.TimelineStyle An interface describing the data returned by calling
Data timelineStyle.toJSON() .
Excel.Interfaces.TimelineStyle Represents a TimelineStyle , which defines style elements by
LoadOptions region in the timeline.
Excel.Interfaces.TimelineStyle An interface for updating data on the TimelineStyle object, for
UpdateData use in timelineStyle.set({ ... }) .
Excel.Interfaces.TopBottom An interface describing the data returned by calling
ConditionalFormatData topBottomConditionalFormat.toJSON() .
Excel.Interfaces.TopBottom Represents a top/bottom conditional format.
ConditionalFormatLoad
Options
Excel.Interfaces.TopBottom An interface for updating data on the
ConditionalFormatUpdate TopBottomConditionalFormat object, for use in
Data topBottomConditionalFormat.set({ ... }) .
Excel.Interfaces.Workbook An interface describing the data returned by calling
CreatedData workbookCreated.toJSON() .
Excel.Interfaces.Workbook An interface describing the data returned by calling
Data workbook.toJSON() .
Excel.Interfaces.Workbook Workbook is the top level object which contains related
LoadOptions workbook objects such as worksheets, tables, and ranges. To
learn more about the workbook object model, read Work with
workbooks using the Excel JavaScript API.
Excel.Interfaces.Workbook An interface describing the data returned by calling
ProtectionData workbookProtection.toJSON() .
Excel.Interfaces.Workbook Represents the protection of a workbook object.
ProtectionLoadOptions
Excel.Interfaces.Workbook An interface describing the data returned by calling
RangeAreasData workbookRangeAreas.toJSON() .
Excel.Interfaces.Workbook Represents a collection of one or more rectangular ranges in
RangeAreasLoadOptions multiple worksheets.
Excel.Interfaces.Workbook An interface for updating data on the Workbook object, for use
UpdateData in workbook.set({ ... }) .
Excel.Interfaces.Worksheet An interface describing the data returned by calling
CollectionData worksheetCollection.toJSON() .
Excel.Interfaces.Worksheet Represents a collection of worksheet objects that are part of the
CollectionLoadOptions workbook.
Excel.Interfaces.Worksheet An interface for updating data on the WorksheetCollection
CollectionUpdateData object, for use in worksheetCollection.set({ ... }) .
Excel.Interfaces.Worksheet An interface describing the data returned by calling
CustomPropertyCollection worksheetCustomPropertyCollection.toJSON() .
Data
Excel.Interfaces.Worksheet Contains the collection of worksheet-level custom property.
CustomPropertyCollection
LoadOptions
Excel.Interfaces.Worksheet An interface for updating data on the
CustomPropertyCollection WorksheetCustomPropertyCollection object, for use in
UpdateData worksheetCustomPropertyCollection.set({ ... }) .
Excel.Interfaces.Worksheet An interface describing the data returned by calling
CustomPropertyData worksheetCustomProperty.toJSON() .
Excel.Interfaces.Worksheet Represents a worksheet-level custom property.
CustomPropertyLoadOptions
Excel.Interfaces.Worksheet An interface for updating data on the WorksheetCustomProperty
CustomPropertyUpdateData object, for use in worksheetCustomProperty.set({ ... }) .
Excel.Interfaces.Worksheet An interface describing the data returned by calling
Data worksheet.toJSON() .
Excel.Interfaces.Worksheet An Excel worksheet is a grid of cells. It can contain data, tables,
LoadOptions charts, etc. To learn more about the worksheet object model,
read Work with worksheets using the Excel JavaScript API.
Excel.Interfaces.Worksheet An interface describing the data returned by calling
ProtectionData worksheetProtection.toJSON() .
Excel.Interfaces.Worksheet Represents the protection of a worksheet object.
ProtectionLoadOptions
Excel.Interfaces.Worksheet An interface for updating data on the Worksheet object, for use
UpdateData in worksheet.set({ ... }) .
Excel.LinkedDataTypeAdded The argument that is passed to the event handler after a new
EventArgs linked data type is added to the workbook.
Excel.LinkedEntityCellValue Represents a value whose properties derive from a service.
Excel.LinkedEntityId The linked entity ID object represents a set of properties that
describes a service and culture for locating this service defined
value.
Excel.ListDataValidation Represents the List data validation criteria.
Excel.LocalImageCellValue Represents the value of a cell containing a locally stored or
generated image.
Excel.LocalImageCellValue The UID of a previously cached image.
CacheId
Excel.NameErrorCellValue Represents the value of a cell containing a #NAME? error.
Excel.NotAvailableErrorCell Represents the value of a cell containing a #N/A! error.
Value
Excel.NullErrorCellValue Represents the value of a cell containing a #NULL! error.
Excel.NumErrorCellValue Represents the value of a cell containing a #NUM! error.
Excel.PageLayoutMargin Represents the options in page layout margins.
Options
Excel.PageLayoutZoom Represents page zoom properties.
Options
Excel.PivotDateFilter Configurable template for a date filter to apply to a PivotField.
The condition defines what criteria need to be set in order for
the filter to operate.
Excel.PivotFilters An interface representing all PivotFilters currently applied to a
given PivotField.
Excel.PivotLabelFilter Configurable template for a label filter to apply to a PivotField.
The condition defines what criteria need to be set in order for
the filter to operate.
Excel.PivotManualFilter Configurable template for a manual filter to apply to a PivotField.
The condition defines what criteria need to be set in order for
the filter to operate.
Excel.PivotValueFilter Configurable template for a value filter to apply to a PivotField.
The condition defines what criteria need to be set in order for
the filter to operate.
Excel.PlaceholderErrorCell Represents the value of a cell containing a #BUSY! error. This
Value type of error is used as a placeholder while the value of a cell is
downloaded.
Excel.RangeHyperlink Represents the necessary strings to get/set a hyperlink (XHL)
object.
Excel.RangeReference Represents a string reference of the form "SheetName!A1:B5", or
a global or local named range.
Excel.ReferenceCellValue Represents a reference into referencedValues . One scenario for
using this reference is to avoid duplicating cell value objects
(such as an EntityCellValue ). Define a cell value object once in
referencedValues , and then refer to that cell value from many
places by using a ReferenceCellValue where the duplicated
value would have appeared.
Excel.RefErrorCellValue Represents the value of a cell containing a #REF! error.
Excel.RefreshModeChanged Represents information about a newly added linked data type,
EventArgs such as source and ID.
Excel.RefreshRequest The argument that is passed to the event handler upon
CompletedEventArgs completion of refresh request to an external service or link.
Excel.ReplaceCriteria Represents the replace criteria to be used.
Excel.RootReferenceCellValue Represents a reference to the value which contains
referencedValues .
Excel.RowProperties Represents the returned properties of getRowProperties.
[ API set: ExcelApi 1.9 ]
Excel.RowPropertiesLoad Represents which row properties to load, when used as part of a
Options "range.getRowProperties" method.
[ API set: ExcelApi 1.9 ]
Excel.RunOptions
Excel.SearchCriteria Represents the search criteria to be used.
Excel.SelectionChangedEvent Provides information about the document that raised the
Args selection changed event.
Excel.Session
Excel.SettableCellProperties Represents the input parameter of setCellProperties.
[ API set: ExcelApi 1.9 ]
Excel.SettableColumn Represents the input parameter of setColumnProperties.
Properties
[ API set: ExcelApi 1.9 ]
Excel.SettableRowProperties Represents the input parameter of setRowProperties.
[ API set: ExcelApi 1.9 ]
Excel.SettingsChangedEvent Provides information about the setting that raised the settings
Args changed event
Excel.ShapeActivatedEvent Provides information about the shape that raised the activated
Args event.
Excel.ShapeDeactivatedEvent Provides information about the shape that raised the deactivated
Args event.
Excel.ShowAsRule
Excel.SortField Represents a condition in a sorting operation.
Excel.SpillErrorCellValue Represents the value of a cell containing a #SPILL! error.
Excel.StringCellValue Represents the value of a cell containing a string.
Excel.Subtotals Subtotals for the Pivot Field.
Excel.TableAddedEventArgs Provides information about the table that raised the added
event.
Excel.TableChangedEventArgs Provides information about the table that raised the changed
event.
Excel.TableDeletedEventArgs Provides information about the table that raised the deleted
event.
Excel.TableFilteredEventArgs Provides information about the table that raised the filter applied
event.
Excel.TableSelectionChanged Provides information about the table that raised the selection
EventArgs changed event.
Excel.ThreeArrowsGraySet [ API set: ExcelApi 1.2 ]
Excel.ThreeArrowsSet [ API set: ExcelApi 1.2 ]
Excel.ThreeFlagsSet [ API set: ExcelApi 1.2 ]
Excel.ThreeSignsSet [ API set: ExcelApi 1.2 ]
Excel.ThreeStarsSet [ API set: ExcelApi 1.2 ]
Excel.ThreeSymbols2Set [ API set: ExcelApi 1.2 ]
Excel.ThreeSymbolsSet [ API set: ExcelApi 1.2 ]
Excel.ThreeTrafficLights1Set [ API set: ExcelApi 1.2 ]
Excel.ThreeTrafficLights2Set [ API set: ExcelApi 1.2 ]
Excel.ThreeTrianglesSet [ API set: ExcelApi 1.2 ]
Excel.ValueErrorCellValue Represents the value of a cell containing a #VALUE! error.
Excel.ValueTypeNotAvailable Represents the value of a cell containing a type of value which
CellValue cannot be serialized. For example, an #UNKNOWN! error which
represents a type of rich value not known to this version of Excel.
Excel.WebImageCellValue Represents the value of a cell containing an image downloaded
from the internet.
Excel.WorkbookActivated Provides information about the workbook that raised the
EventArgs activated event.
Excel.WorkbookAutoSave Provides information about the workbook's
SettingChangedEventArgs onAutoSaveSettingChanged event.
Excel.WorksheetActivated Provides information about the worksheet that raised the
EventArgs activated event.
Excel.WorksheetAddedEvent Provides information about the worksheet that raised the added
Args event.
Excel.WorksheetCalculated Provides information about the worksheet that raised the
EventArgs calculated event.
Excel.WorksheetChanged Provides information about the worksheet that raised the
EventArgs changed event.
Excel.WorksheetColumn Provides information about the column-sorted event and its
SortedEventArgs related worksheet.
Excel.WorksheetDeactivated Provides information about the worksheet that raised the
EventArgs deactivated event.
Excel.WorksheetDeletedEvent Provides information about the worksheet that raised the
Args deleted event.
Excel.WorksheetFilteredEvent Provides information about the worksheet that raised the filter
Args applied event.
Excel.WorksheetFormat Provides information about the worksheet format change event.
ChangedEventArgs
Excel.WorksheetFormula Provides information about the worksheet and formulas that
ChangedEventArgs raised the formula changed event.
Excel.WorksheetMovedEvent Notifies when a worksheet is moved within a workbook.
Args
If a worksheet is moved from one position within the workbook
to another via the Excel UI, then this API will trigger an event.
Note that if the position of a worksheet changes as a result of
moving a different worksheet, then this event won't trigger for
both position changes. This event only triggers for the primary
worksheet move, and not any worksheet position changes that
occur as a result of that primary move.
Excel.WorksheetName Provides information about the worksheet whose name has
ChangedEventArgs changed.
Excel.WorksheetProtection Provides information about the worksheet that raised the
ChangedEventArgs protection status changed event, which fires when the protection
status is updated in a worksheet.
Excel.WorksheetProtection Represents the options in sheet protection.
Options
Excel.WorksheetRowHidden Provides information about the worksheet's row hidden change
ChangedEventArgs event.
Excel.WorksheetRowSorted Provides information about the row-sorted event and its related
EventArgs worksheet.
Excel.WorksheetSearchCriteria Represents the worksheet search criteria to be used.
Excel.WorksheetSelection Provides information about the worksheet that raised the
ChangedEventArgs selection changed event.
Excel.WorksheetSingleClicked Provides information about the left-clicked/tapped event and its
EventArgs related worksheet.
Excel.WorksheetVisibility Provides information about the worksheet whose visibility has
ChangedEventArgs changed.
Type Aliases
Excel.CardLayout Represents the layout of a card in card view.
Excel.CardLayoutSection Represents the layout of a section of a card in card view.
Excel.CellValue Represents the value in a cell.
Excel.CellValueAndProperty Represents the value and metadata of a property. The metadata
Metadata applies to the property (and not the value), but it is combined
with the value in this type.
Excel.CompactLayout Represents the layout used when there is limited space to
represent the entity.
Excel.EntityPropertyType Represents the value of a property.
Excel.ErrorCellValue Represents a cell value which contains an error.
Excel.ReferencedValue Represents the value in a cell.
Enums
Excel.AggregationFunction Aggregation function for the DataPivotHierarchy .
Excel.ArrowheadLength
Excel.ArrowheadStyle
Excel.ArrowheadWidth
Excel.AutoFillType The behavior types when AutoFill is used on a range in the
workbook.
Excel.Base64EncodingType The file type represented by the base64 encoding.
Excel.BindingType
Excel.BlockedErrorCellValue Represents types of #BLOCKED! errors.
SubType
Excel.BorderIndex
Excel.BorderLineStyle
Excel.BorderWeight
Excel.BuiltInPivotTableStyle Represents a built-in PivotTable style
Excel.BuiltInSlicerStyle Represents a built-in slicer style.
Excel.BuiltInStyle
Excel.BuiltInTableStyle Represents a built-in table style.
Excel.BusyErrorCellValueSub Represents types of #BUSY! errors.
Type
Excel.CalcErrorCellValueSub Represents types of #CALC! errors.
Type
Excel.CalculationMode
Excel.CalculationState Represents the state of calculation across the entire Excel
application.
Excel.CalculationType
Excel.CellValueType Represents the types of the CellValue object.
Excel.ChartAxisCategoryType Specifies the type of the category axis.
Excel.ChartAxisDisplayUnit
Excel.ChartAxisGroup
Excel.ChartAxisPosition
Excel.ChartAxisScaleType
Excel.ChartAxisTickLabelPosition
Excel.ChartAxisTickMark
Excel.ChartAxisTimeUnit Specifies the unit of time for chart axes and data series.
Excel.ChartAxisType
Excel.ChartBinType Specifies the bin type of a histogram chart or pareto chart series.
Excel.ChartBoxQuartile Represents the quartile calculation type of chart series layout.
Calculation Only applies to a box and whisker chart.
Excel.ChartColorScheme
Excel.ChartDataLabelPosition
Excel.ChartDataSourceType Specifies the data source type of the chart series.
Excel.ChartDisplayBlanksAs
Excel.ChartErrorBarsInclude Represents which parts of the error bar to include.
Excel.ChartErrorBarsType Represents the range type for error bars.
Excel.ChartGradientStyle Represents the gradient style of a chart series. This is only
applicable for region map charts.
Excel.ChartGradientStyleType Represents the gradient style type of a chart series. This is only
applicable for region map charts.
Excel.ChartLegendPosition
Excel.ChartLineStyle
Excel.ChartMapAreaLevel Represents the mapping level of a chart series. This only applies
to region map charts.
Excel.ChartMapLabelStrategy Represents the region level of a chart series layout. This only
applies to region map charts.
Excel.ChartMapProjectionType Represents the region projection type of a chart series layout.
This only applies to region map charts.
Excel.ChartMarkerStyle
Excel.ChartParentLabel Represents the parent label strategy of the chart series layout.
Strategy This only applies to treemap charts
Excel.ChartPlotAreaPosition
Excel.ChartPlotBy
Excel.ChartSeriesBy Specifies whether the series are by rows or by columns. In Excel
on desktop, the "auto" option will inspect the source data shape
to automatically guess whether the data is by rows or columns.
In Excel on the web, "auto" will simply default to "columns".
Excel.ChartSeriesDimension Represents the dimensions when getting values from chart
series.
Excel.ChartSplitType
Excel.ChartTextHorizontal Represents the horizontal alignment for the specified object.
Alignment
Excel.ChartTextVertical Represents the vertical alignment for the specified object.
Alignment
Excel.ChartTickLabelAlignment
Excel.ChartTitlePosition Represents the position of the chart title.
Excel.ChartTrendlineType
Excel.ChartType
Excel.ChartUnderlineStyle
Excel.ClearApplyTo
Excel.CloseBehavior Specifies the close behavior for Workbook.close .
Excel.CommentChangeType Represents how the comments in the event were changed.
Excel.ConditionalCellValue Represents the operator of the text conditional format type.
Operator
Excel.ConditionalDataBarAxis Represents the format options for a data bar axis.
Format
Excel.ConditionalDataBar Represents the data bar direction within a cell.
Direction
Excel.ConditionalFormatColor Represents the types of color criterion for conditional formatting.
CriterionType
Excel.ConditionalFormat Represents the direction for a selection.
Direction
Excel.ConditionalFormatIcon Represents the types of icon conditional format.
RuleType
Excel.ConditionalFormatPreset Represents the criteria of the preset criteria conditional format
Criterion type.
Excel.ConditionalFormatRule Represents the types of conditional format values.
Type
Excel.ConditionalFormatType
Excel.ConditionalIconCriterion Represents the operator for each icon criteria.
Operator
Excel.ConditionalRangeBorderIndex
Excel.ConditionalRangeBorderLineStyle
Excel.ConditionalRangeFontUnderlineStyle
Excel.ConditionalTextOperator Represents the operator of the text conditional format type.
Excel.ConditionalTopBottom Represents the criteria for the above/below average conditional
CriterionType format type.
Excel.ConnectErrorCellValue Represents types of #CONNECT! errors.
SubType
Excel.ConnectorType
Excel.ContentType
Excel.DataChangeType
Excel.DataSourceType Represents a command type of DataConnection .
Excel.DataValidationAlertStyle Represents the data validation error alert style. The default is
Stop .
Excel.DataValidationOperator Represents the data validation operator enum.
Excel.DataValidationType Represents the data validation type enum.
Excel.DateFilterCondition Enum representing all accepted conditions by which a date filter
can be applied. Used to configure the type of PivotFilter that is
applied to the field.
Excel.DeleteShiftDirection
Excel.DocumentPropertyItem
Excel.DocumentPropertyType
Excel.DocumentTaskChange Represents the type of change recorded in the task change
Action record.
Excel.DynamicFilterCriteria
Excel.EntityCardLayoutType Types of entity card layouts.
Excel.EntityCompactLayout The list of icons available for EntityCompactLayout . An icon
Icons displays in the Excel UI, either to the left of the title in a cell that
contains an entity card, or to the left of the title of a referenced
entity inside an entity card. Selecting the icon opens the entity
card.
Excel.ErrorCellValueType Represents the types of the ErrorCellValue object.
Excel.ErrorCodes
Excel.EventSource
Excel.EventTriggerSource
Excel.EventType
Excel.ExternalErrorCellValue Represents types of #EXTERNAL! errors.
SubType
Excel.FieldErrorCellValueSub Represents types of #FIELD! errors.
Type
Excel.FillPattern
Excel.FilterDatetimeSpecificity
Excel.FilterOn
Excel.FilterOperator
Excel.GeometricShapeType Specifies the shape type for a GeometricShape object.
Excel.GroupOption
Excel.HeaderFooterState
Excel.HorizontalAlignment
Excel.IconSet
Excel.ImageFittingMode
Excel.InsertShiftDirection
Excel.KeyboardDirection
Excel.LabelFilterCondition Enum representing all accepted conditions by which a label filter
can be applied. Used to configure the type of PivotFilter that is
applied to the field. PivotFilter.criteria.exclusive can be set
to true to invert many of these conditions.
Excel.LinkedDataTypeRefresh Representation of a refresh mode.
Mode
Excel.LinkedDataTypeState
Excel.LoadToType An enum that specifies the query load to destination.
Excel.NamedItemScope
Excel.NamedItemType
Excel.NumberFormatCategory Represents a category of number formats.
Excel.NumErrorCellValueSub Represents types of #NUM! errors.
Type
Excel.PageOrientation
Excel.PaperType
Excel.PictureFormat The format of the image.
Excel.PivotAxis Represents the axis from which to get the PivotItems.
Excel.PivotFilterTopBottom Represents the criteria for the top/bottom values filter.
Criterion
Excel.PivotFilterType A simple enum that represents a type of filter for a PivotField.
Excel.PivotLayoutType
Excel.PivotTableDateGroupBy Represents the DateTime Grouping condition.
Excel.Placement Specifies the way that an object is attached to its underlying
cells.
Excel.PrintComments
Excel.PrintErrorType
Excel.PrintMarginUnit
Excel.PrintOrder
Excel.ProtectionSelectionMode
Excel.QueryError An enum that specifies the query load error message.
Excel.RangeCopyType
Excel.RangeUnderlineStyle
Excel.RangeValueType
Excel.ReadingOrder
Excel.ReferenceValueType Represents the types of the ReferenceValue object.
Excel.RefErrorCellValueSub Represents types of #REF! errors.
Type
Excel.RibbonTab
Excel.RowHiddenChangeType
Excel.SaveBehavior Specifies the save behavior for Workbook.save .
Excel.SearchDirection Specifies the search direction.
Excel.ShapeAutoSize Determines the type of automatic sizing allowed.
Excel.ShapeFillType Specifies a shape's fill type.
Excel.ShapeFontUnderline The type of underline applied to a font.
Style
Excel.ShapeLineDashStyle The dash style for a line.
Excel.ShapeLineStyle The style for a line.
Excel.ShapeScaleFrom Specifies which part of the shape retains its position when the
shape is scaled.
Excel.ShapeScaleType Specifies whether the shape is scaled relative to its original or
current size.
Excel.ShapeTextHorizontal Specifies the horizontal alignment for the text frame in a shape.
Alignment
Excel.ShapeTextHorizontal Specifies the horizontal overflow for the text frame in a shape.
Overflow
Excel.ShapeTextOrientation Specifies the orientation for the text frame in a shape.
Excel.ShapeTextReadingOrder Specifies the reading order for the text frame in a shape.
Excel.ShapeTextVertical Specifies the vertical alignment for the text frame in a shape.
Alignment
Excel.ShapeTextVertical Specifies the vertical overflow for the text frame in a shape.
Overflow
Excel.ShapeType Specifies the type of a shape.
Excel.ShapeZOrder Specifies where in the z-order a shape should be moved relative
to other shapes.
Excel.SheetVisibility
Excel.ShowAsCalculation The ShowAs calculation function for the DataPivotField.
Excel.SlicerSortType Specifies the slicer sort behavior for Slicer.sortBy .
Excel.SortBy Represents the sort direction.
Excel.SortDataOption
Excel.SortMethod
Excel.SortOn
Excel.SortOrientation
Excel.SpecialCellType
Excel.SpecialCellValueType
Excel.SpillErrorCellValueSub Represents types of #SPILL! errors.
Type
Excel.SubtotalLocationType
Excel.TopBottomSelectionType A simple enum for top/bottom filters to select whether to filter
by the top N or bottom N percent, number, or sum of values.
Excel.ValueErrorCellValueSub Represents types of #VALUE! errors.
Type
Excel.ValueFilterCondition Enum representing all accepted conditions by which a value filter
can be applied. Used to configure the type of PivotFilter that is
applied to the field. PivotFilter.exclusive can be set to true to
invert many of these conditions.
Excel.VerticalAlignment
Excel.WorkbookLinksRefresh Represents the refresh mode of the workbook links.
Mode
Excel.WorksheetPositionType
Functions
Excel.createWorkbook(base64) Creates and opens a new workbook. Optionally, the workbook
can be pre-populated with a base64-encoded .xlsx file. Note:
Macros can be a security risk. If this API is used to create a
workbook that includes a macro, the add-in user will be
prompted with a "Trust this add-in?" dialog in the Excel UI. The
user must select the "Trust add-in" button to proceed.
[ API set: ExcelApi 1.8 ]
Excel.getDataCommon
Postprocess(response, call
Args)
Excel.postprocessBinding
Descriptor(response)
Excel.run(batch) Executes a batch script that performs actions on the Excel object
model, using a new RequestContext. When the promise is
resolved, any tracked objects that were automatically allocated
during execution will be released.
Excel.run(object, batch) Executes a batch script that performs actions on the Excel object
model, using the RequestContext of a previously-created API
object. When the promise is resolved, any tracked objects that
were automatically allocated during execution will be released.
Excel.run(objects, batch) Executes a batch script that performs actions on the Excel object
model, using the RequestContext of previously-created API
objects.
Excel.run(options, batch) Executes a batch script that performs actions on the Excel object
model, using the RequestContext of a previously-created API
object. When the promise is resolved, any tracked objects that
were automatically allocated during execution will be released.
Excel.run(context, batch) Executes a batch script that performs actions on the Excel object
model, using the RequestContext of a previously-created object.
When the promise is resolved, any tracked objects that were
automatically allocated during execution will be released.
Function Details
Excel.createWorkbook(base64)
Creates and opens a new workbook. Optionally, the workbook can be pre-populated
with a base64-encoded .xlsx file. Note: Macros can be a security risk. If this API is
used to create a workbook that includes a macro, the add-in user will be prompted
with a "Trust this add-in?" dialog in the Excel UI. The user must select the "Trust add-
in" button to proceed.
[ API set: ExcelApi 1.8 ]
TypeScript
export function createWorkbook(base64?: string): Promise<void>;
Parameters
base64 string
Returns
Promise<void>
Examples
TypeScript
const myFile = <HTMLInputElement>document.getElementById("file");
const reader = new FileReader();
reader.onload = (event) => {
Excel.run((context) => {
// Remove the metadata before the base64-encoded string.
const startIndex = reader.result.toString().indexOf("base64,");
const mybase64 = reader.result.toString().substr(startIndex + 7);
Excel.createWorkbook(mybase64);
return context.sync();
});
};
// Read in the file as a data URL so we can parse the base64-encoded
string.
reader.readAsDataURL(myFile.files[0]);
Excel.getDataCommonPostprocess(response, callArgs)
TypeScript
export function getDataCommonPostprocess(response: any, callArgs: any):
any;
Parameters
response any
callArgs any
Returns
any
Excel.postprocessBindingDescriptor(response)
TypeScript
export function postprocessBindingDescriptor(response: any): any;
Parameters
response any
Returns
any
Excel.run(batch)
Executes a batch script that performs actions on the Excel object model, using a new
RequestContext. When the promise is resolved, any tracked objects that were
automatically allocated during execution will be released.
TypeScript
export function run<T>(batch: (context: Excel.RequestContext) =>
Promise<T>): Promise<T>;
Parameters
batch (context: Excel.RequestContext) => Promise<T>
A function that takes in a RequestContext and returns a promise (typically, just the
result of "context.sync()"). The context parameter facilitates requests to the Excel
application. Since the Office add-in and the Excel application run in two different
processes, the RequestContext is required to get access to the Excel object model
from the add-in.
Returns
Promise<T>
Excel.run(object, batch)
Executes a batch script that performs actions on the Excel object model, using the
RequestContext of a previously-created API object. When the promise is resolved,
any tracked objects that were automatically allocated during execution will be
released.
TypeScript
export function run<T>(object: OfficeExtension.ClientObject, batch:
(context: Excel.RequestContext) => Promise<T>): Promise<T>;
Parameters
object OfficeExtension.ClientObject
A previously-created API object. The batch will use the same RequestContext as the
passed-in object, which means that any changes applied to the object will be picked
up by "context.sync()".
batch (context: Excel.RequestContext) => Promise<T>
A function that takes in a RequestContext and returns a promise (typically, just the
result of "context.sync()"). The context parameter facilitates requests to the Excel
application. Since the Office add-in and the Excel application run in two different
processes, the RequestContext is required to get access to the Excel object model
from the add-in.
Returns
Promise<T>
Excel.run(objects, batch)
Executes a batch script that performs actions on the Excel object model, using the
RequestContext of previously-created API objects.
TypeScript
export function run<T>(objects: OfficeExtension.ClientObject[], batch:
(context: Excel.RequestContext) => Promise<T>): Promise<T>;
Parameters
objects OfficeExtension.ClientObject[]
An array of previously-created API objects. The array will be validated to make sure
that all of the objects share the same context. The batch will use this shared
RequestContext, which means that any changes applied to these objects will be
picked up by "context.sync()".
batch (context: Excel.RequestContext) => Promise<T>
A function that takes in a RequestContext and returns a promise (typically, just the
result of "context.sync()"). The context parameter facilitates requests to the Excel
application. Since the Office add-in and the Excel application run in two different
processes, the RequestContext is required to get access to the Excel object model
from the add-in.
Returns
Promise<T>
Excel.run(options, batch)
Executes a batch script that performs actions on the Excel object model, using the
RequestContext of a previously-created API object. When the promise is resolved,
any tracked objects that were automatically allocated during execution will be
released.
TypeScript
export function run<T>(options: Excel.RunOptions, batch: (context:
Excel.RequestContext) => Promise<T>): Promise<T>;
Parameters
options Excel.RunOptions
The additional options for this Excel.run which specify previous objects, whether to
delay the request for cell edit, session info, etc.
batch (context: Excel.RequestContext) => Promise<T>
A function that takes in a RequestContext and returns a promise (typically, just the
result of "context.sync()"). The context parameter facilitates requests to the Excel
application. Since the Office add-in and the Excel application run in two different
processes, the RequestContext is required to get access to the Excel object model
from the add-in.
Returns
Promise<T>
Excel.run(context, batch)
Executes a batch script that performs actions on the Excel object model, using the
RequestContext of a previously-created object. When the promise is resolved, any
tracked objects that were automatically allocated during execution will be released.
TypeScript
export function run<T>(context: OfficeExtension.ClientRequestContext,
batch: (context: Excel.RequestContext) => Promise<T>): Promise<T>;
Parameters
context OfficeExtension.ClientRequestContext
A previously-created object. The batch will use the same RequestContext as the
passed-in object, which means that any changes applied to the object will be picked
up by "context.sync()".
batch (context: Excel.RequestContext) => Promise<T>
A function that takes in a RequestContext and returns a promise (typically, just the
result of "context.sync()"). The context parameter facilitates requests to the Excel
application. Since the Office add-in and the Excel application run in two different
processes, the RequestContext is required to get access to the Excel object model
from the add-in.
Returns
Promise<T>
onenote package
Reference
Classes
OneNote.Application Represents the top-level object that contains all globally
addressable OneNote objects such as notebooks, the active
notebook, and the active section.
OneNote.FloatingInk Represents a group of ink strokes.
OneNote.Image Represents an Image. An Image can be a direct child of a
PageContent object or a Paragraph object.
OneNote.InkAnalysis Represents ink analysis data for a given set of ink strokes.
OneNote.InkAnalysisLine Represents ink analysis data for an identified text line formed by
ink strokes.
OneNote.InkAnalysisLine Represents a collection of InkAnalysisLine objects.
Collection
OneNote.InkAnalysis Represents ink analysis data for an identified paragraph formed
Paragraph by ink strokes.
OneNote.InkAnalysis Represents a collection of InkAnalysisParagraph objects.
ParagraphCollection
OneNote.InkAnalysisWord Represents ink analysis data for an identified word formed by ink
strokes.
OneNote.InkAnalysisWord Represents a collection of InkAnalysisWord objects.
Collection
OneNote.InkStroke Represents a single stroke of ink.
OneNote.InkStrokeCollection Represents a collection of InkStroke objects.
OneNote.InkWord A container for the ink in a word in a paragraph.
OneNote.InkWordCollection Represents a collection of InkWord objects.
OneNote.Notebook Represents a OneNote notebook. Notebooks contain section
groups and sections.
OneNote.NotebookCollection Represents a collection of notebooks.
OneNote.NoteTag A container for the NoteTag in a paragraph.
OneNote.Outline Represents a container for Paragraph objects.
OneNote.Page Represents a OneNote page.
OneNote.PageCollection Represents a collection of pages.
OneNote.PageContent Represents a region on a page that contains top-level content
types such as Outline or Image. A PageContent object can be
assigned an XY position.
OneNote.PageContent Represents the contents of a page, as a collection of
Collection PageContent objects.
OneNote.Paragraph A container for the visible content on a page. A Paragraph can
contain any one ParagraphType type of content.
OneNote.ParagraphCollection Represents a collection of Paragraph objects.
OneNote.Point Represents a single point of ink stroke
OneNote.PointCollection Represents a collection of Point objects.
OneNote.RequestContext
OneNote.RichText Represents a RichText object in a Paragraph.
OneNote.Section Represents a OneNote section. Sections can contain pages.
OneNote.SectionCollection Represents a collection of sections.
OneNote.SectionGroup Represents a OneNote section group. Section groups can
contain sections and other section groups.
OneNote.SectionGroup Represents a collection of section groups.
Collection
OneNote.Table Represents a table in a OneNote page.
OneNote.TableCell Represents a cell in a OneNote table.
OneNote.TableCellCollection Contains a collection of TableCell objects.
OneNote.TableRow Represents a row in a table.
OneNote.TableRowCollection Contains a collection of TableRow objects.
Interfaces
OneNote.ImageOcrData Represents data obtained by OCR (optical character recognition)
of an image.
OneNote.InkStrokePointer Weak reference to an ink stroke object and its content parent.
OneNote.Interfaces. An interface describing the data returned by calling
ApplicationData application.toJSON() .
OneNote.Interfaces. Represents the top-level object that contains all globally
ApplicationLoadOptions addressable OneNote objects such as notebooks, the active
notebook, and the active section.
OneNote.Interfaces. An interface for updating data on the Application object, for use
ApplicationUpdateData in application.set({ ... }) .
OneNote.Interfaces.Collection Provides ways to load properties of only a subset of members of
LoadOptions a collection.
OneNote.Interfaces.Floating An interface describing the data returned by calling
InkData floatingInk.toJSON() .
OneNote.Interfaces.Floating Represents a group of ink strokes.
InkLoadOptions
OneNote.Interfaces.Image An interface describing the data returned by calling
Data image.toJSON() .
OneNote.Interfaces.Image Represents an Image. An Image can be a direct child of a
LoadOptions PageContent object or a Paragraph object.
OneNote.Interfaces.Image An interface for updating data on the Image object, for use in
UpdateData image.set({ ... }) .
OneNote.Interfaces.Ink An interface describing the data returned by calling
AnalysisData inkAnalysis.toJSON() .
OneNote.Interfaces.Ink An interface describing the data returned by calling
AnalysisLineCollectionData inkAnalysisLineCollection.toJSON() .
OneNote.Interfaces.Ink Represents a collection of InkAnalysisLine objects.
AnalysisLineCollectionLoad
Options
OneNote.Interfaces.Ink An interface for updating data on the InkAnalysisLineCollection
AnalysisLineCollectionUpdate object, for use in inkAnalysisLineCollection.set({ ... }) .
Data
OneNote.Interfaces.Ink An interface describing the data returned by calling
AnalysisLineData inkAnalysisLine.toJSON() .
OneNote.Interfaces.Ink Represents ink analysis data for an identified text line formed by
AnalysisLineLoadOptions ink strokes.
OneNote.Interfaces.Ink An interface for updating data on the InkAnalysisLine object, for
AnalysisLineUpdateData use in inkAnalysisLine.set({ ... }) .
OneNote.Interfaces.Ink Represents ink analysis data for a given set of ink strokes.
AnalysisLoadOptions
OneNote.Interfaces.Ink An interface describing the data returned by calling
AnalysisParagraphCollection inkAnalysisParagraphCollection.toJSON() .
Data
OneNote.Interfaces.Ink Represents a collection of InkAnalysisParagraph objects.
AnalysisParagraphCollection
LoadOptions
OneNote.Interfaces.Ink An interface for updating data on the
AnalysisParagraphCollection InkAnalysisParagraphCollection object, for use in
UpdateData inkAnalysisParagraphCollection.set({ ... }) .
OneNote.Interfaces.Ink An interface describing the data returned by calling
AnalysisParagraphData inkAnalysisParagraph.toJSON() .
OneNote.Interfaces.Ink Represents ink analysis data for an identified paragraph formed
AnalysisParagraphLoad by ink strokes.
Options
OneNote.Interfaces.Ink An interface for updating data on the InkAnalysisParagraph
AnalysisParagraphUpdateData object, for use in inkAnalysisParagraph.set({ ... }) .
OneNote.Interfaces.Ink An interface for updating data on the InkAnalysis object, for use
AnalysisUpdateData in inkAnalysis.set({ ... }) .
OneNote.Interfaces.Ink An interface describing the data returned by calling
AnalysisWordCollectionData inkAnalysisWordCollection.toJSON() .
OneNote.Interfaces.Ink Represents a collection of InkAnalysisWord objects.
AnalysisWordCollectionLoad
Options
OneNote.Interfaces.Ink An interface for updating data on the InkAnalysisWordCollection
AnalysisWordCollection object, for use in inkAnalysisWordCollection.set({ ... }) .
UpdateData
OneNote.Interfaces.Ink An interface describing the data returned by calling
AnalysisWordData inkAnalysisWord.toJSON() .
OneNote.Interfaces.Ink Represents ink analysis data for an identified word formed by ink
AnalysisWordLoadOptions strokes.
OneNote.Interfaces.Ink An interface for updating data on the InkAnalysisWord object,
AnalysisWordUpdateData for use in inkAnalysisWord.set({ ... }) .
OneNote.Interfaces.InkStroke An interface describing the data returned by calling
CollectionData inkStrokeCollection.toJSON() .
OneNote.Interfaces.InkStroke Represents a collection of InkStroke objects.
CollectionLoadOptions
OneNote.Interfaces.InkStroke An interface for updating data on the InkStrokeCollection object,
CollectionUpdateData for use in inkStrokeCollection.set({ ... }) .
OneNote.Interfaces.InkStroke An interface describing the data returned by calling
Data inkStroke.toJSON() .
OneNote.Interfaces.InkStroke Represents a single stroke of ink.
LoadOptions
OneNote.Interfaces.InkWord An interface describing the data returned by calling
CollectionData inkWordCollection.toJSON() .
OneNote.Interfaces.InkWord Represents a collection of InkWord objects.
CollectionLoadOptions
OneNote.Interfaces.InkWord An interface for updating data on the InkWordCollection object,
CollectionUpdateData for use in inkWordCollection.set({ ... }) .
OneNote.Interfaces.InkWord An interface describing the data returned by calling
Data inkWord.toJSON() .
OneNote.Interfaces.InkWord A container for the ink in a word in a paragraph.
LoadOptions
OneNote.Interfaces.Notebook An interface describing the data returned by calling
CollectionData notebookCollection.toJSON() .
OneNote.Interfaces.Notebook Represents a collection of notebooks.
CollectionLoadOptions
OneNote.Interfaces.Notebook An interface for updating data on the NotebookCollection
CollectionUpdateData object, for use in notebookCollection.set({ ... }) .
OneNote.Interfaces.Notebook An interface describing the data returned by calling
Data notebook.toJSON() .
OneNote.Interfaces.Notebook Represents a OneNote notebook. Notebooks contain section
LoadOptions groups and sections.
OneNote.Interfaces.NoteTag An interface describing the data returned by calling
Data noteTag.toJSON() .
OneNote.Interfaces.NoteTag A container for the NoteTag in a paragraph.
LoadOptions
OneNote.Interfaces.Outline An interface describing the data returned by calling
Data outline.toJSON() .
OneNote.Interfaces.Outline Represents a container for Paragraph objects.
LoadOptions
OneNote.Interfaces.Page An interface describing the data returned by calling
CollectionData pageCollection.toJSON() .
OneNote.Interfaces.Page Represents a collection of pages.
CollectionLoadOptions
OneNote.Interfaces.Page An interface for updating data on the PageCollection object, for
CollectionUpdateData use in pageCollection.set({ ... }) .
OneNote.Interfaces.Page An interface describing the data returned by calling
ContentCollectionData pageContentCollection.toJSON() .
OneNote.Interfaces.Page Represents the contents of a page, as a collection of
ContentCollectionLoad PageContent objects.
Options
OneNote.Interfaces.Page An interface for updating data on the PageContentCollection
ContentCollectionUpdateData object, for use in pageContentCollection.set({ ... }) .
OneNote.Interfaces.Page An interface describing the data returned by calling
ContentData pageContent.toJSON() .
OneNote.Interfaces.Page Represents a region on a page that contains top-level content
ContentLoadOptions types such as Outline or Image. A PageContent object can be
assigned an XY position.
OneNote.Interfaces.Page An interface for updating data on the PageContent object, for
ContentUpdateData use in pageContent.set({ ... }) .
OneNote.Interfaces.PageData An interface describing the data returned by calling
page.toJSON() .
OneNote.Interfaces.PageLoad Represents a OneNote page.
Options
OneNote.Interfaces.Page An interface for updating data on the Page object, for use in
UpdateData page.set({ ... }) .
OneNote.Interfaces.Paragraph An interface describing the data returned by calling
CollectionData paragraphCollection.toJSON() .
OneNote.Interfaces.Paragraph Represents a collection of Paragraph objects.
CollectionLoadOptions
OneNote.Interfaces.Paragraph An interface for updating data on the ParagraphCollection
CollectionUpdateData object, for use in paragraphCollection.set({ ... }) .
OneNote.Interfaces.Paragraph An interface describing the data returned by calling
Data paragraph.toJSON() .
OneNote.Interfaces.Paragraph A container for the visible content on a page. A Paragraph can
LoadOptions contain any one ParagraphType type of content.
OneNote.Interfaces.Paragraph An interface for updating data on the Paragraph object, for use
UpdateData in paragraph.set({ ... }) .
OneNote.Interfaces.Point An interface describing the data returned by calling
CollectionData pointCollection.toJSON() .
OneNote.Interfaces.Point Represents a collection of Point objects.
CollectionLoadOptions
OneNote.Interfaces.Point An interface for updating data on the PointCollection object, for
CollectionUpdateData use in pointCollection.set({ ... }) .
OneNote.Interfaces.PointData An interface describing the data returned by calling
point.toJSON() .
OneNote.Interfaces.PointLoad Represents a single point of ink stroke
Options
OneNote.Interfaces.RichText An interface describing the data returned by calling
Data richText.toJSON() .
OneNote.Interfaces.RichText Represents a RichText object in a Paragraph.
LoadOptions
OneNote.Interfaces.Section An interface describing the data returned by calling
CollectionData sectionCollection.toJSON() .
OneNote.Interfaces.Section Represents a collection of sections.
CollectionLoadOptions
OneNote.Interfaces.Section An interface for updating data on the SectionCollection object,
CollectionUpdateData for use in sectionCollection.set({ ... }) .
OneNote.Interfaces.Section An interface describing the data returned by calling
Data section.toJSON() .
OneNote.Interfaces.Section An interface describing the data returned by calling
GroupCollectionData sectionGroupCollection.toJSON() .
OneNote.Interfaces.Section Represents a collection of section groups.
GroupCollectionLoadOptions
OneNote.Interfaces.Section An interface for updating data on the SectionGroupCollection
GroupCollectionUpdateData object, for use in sectionGroupCollection.set({ ... }) .
OneNote.Interfaces.Section An interface describing the data returned by calling
GroupData sectionGroup.toJSON() .
OneNote.Interfaces.Section Represents a OneNote section group. Section groups can
GroupLoadOptions contain sections and other section groups.
OneNote.Interfaces.Section Represents a OneNote section. Sections can contain pages.
LoadOptions
OneNote.Interfaces.TableCell An interface describing the data returned by calling
CollectionData tableCellCollection.toJSON() .
OneNote.Interfaces.TableCell Contains a collection of TableCell objects.
CollectionLoadOptions
OneNote.Interfaces.TableCell An interface for updating data on the TableCellCollection object,
CollectionUpdateData for use in tableCellCollection.set({ ... }) .
OneNote.Interfaces.TableCell An interface describing the data returned by calling
Data tableCell.toJSON() .
OneNote.Interfaces.TableCell Represents a cell in a OneNote table.
LoadOptions
OneNote.Interfaces.TableCell An interface for updating data on the TableCell object, for use in
UpdateData tableCell.set({ ... }) .
OneNote.Interfaces.TableData An interface describing the data returned by calling
table.toJSON() .
OneNote.Interfaces.TableLoad Represents a table in a OneNote page.
Options
OneNote.Interfaces.TableRow An interface describing the data returned by calling
CollectionData tableRowCollection.toJSON() .
OneNote.Interfaces.TableRow Contains a collection of TableRow objects.
CollectionLoadOptions
OneNote.Interfaces.TableRow An interface for updating data on the TableRowCollection object,
CollectionUpdateData for use in tableRowCollection.set({ ... }) .
OneNote.Interfaces.TableRow An interface describing the data returned by calling
Data tableRow.toJSON() .
OneNote.Interfaces.TableRow Represents a row in a table.
LoadOptions
OneNote.Interfaces.Table An interface for updating data on the Table object, for use in
UpdateData table.set({ ... }) .
OneNote.ParagraphInfo List information for paragraph.
Enums
OneNote.ErrorCodes
OneNote.EventType
OneNote.InsertLocation
OneNote.ListType
OneNote.NoteTagStatus
OneNote.NoteTagType
OneNote.NumberType
OneNote.PageContentType
OneNote.ParagraphStyle
OneNote.ParagraphType
Functions
OneNote.run(batch) Executes a batch script that performs actions on the OneNote
object model, using a new request context. When the promise is
resolved, any tracked objects that were automatically allocated
during execution will be released.
OneNote.run(object, batch) Executes a batch script that performs actions on the OneNote
object model, using the request context of a previously-created
API object.
OneNote.run(objects, batch) Executes a batch script that performs actions on the OneNote
object model, using the request context of previously-created
API objects.
Function Details
OneNote.run(batch)
Executes a batch script that performs actions on the OneNote object model, using a
new request context. When the promise is resolved, any tracked objects that were
automatically allocated during execution will be released.
TypeScript
export function run<T>(batch: (context: OneNote.RequestContext) =>
Promise<T>): Promise<T>;
Parameters
batch (context: OneNote.RequestContext) => Promise<T>
A function that takes in an OneNote.RequestContext and returns a promise (typically,
just the result of "context.sync()"). The context parameter facilitates requests to the
OneNote application. Since the Office add-in and the OneNote application run in
two different processes, the request context is required to get access to the OneNote
object model from the add-in.
Returns
Promise<T>
OneNote.run(object, batch)
Executes a batch script that performs actions on the OneNote object model, using
the request context of a previously-created API object.
TypeScript
export function run<T>(object: OfficeExtension.ClientObject, batch:
(context: OneNote.RequestContext) => Promise<T>): Promise<T>;
Parameters
object OfficeExtension.ClientObject
A previously-created API object. The batch will use the same request context as the
passed-in object, which means that any changes applied to the object will be picked
up by "context.sync()".
batch (context: OneNote.RequestContext) => Promise<T>
A function that takes in an OneNote.RequestContext and returns a promise (typically,
just the result of "context.sync()"). When the promise is resolved, any tracked objects
that were automatically allocated during execution will be released.
Returns
Promise<T>
OneNote.run(objects, batch)
Executes a batch script that performs actions on the OneNote object model, using
the request context of previously-created API objects.
TypeScript
export function run<T>(objects: OfficeExtension.ClientObject[], batch:
(context: OneNote.RequestContext) => Promise<T>): Promise<T>;
Parameters
objects OfficeExtension.ClientObject[]
batch (context: OneNote.RequestContext) => Promise<T>
A function that takes in an OneNote.RequestContext and returns a promise (typically,
just the result of "context.sync()"). When the promise is resolved, any tracked objects
that were automatically allocated during execution will be released.
Returns
Promise<T>
outlook package
Reference
Interfaces
Office.Appointment The subclass of Item dealing with appointments.
Important: This is an internal Outlook object, not directly
exposed through existing interfaces. You should treat this as a
mode of Office.context.mailbox.item . For more information,
refer to the Object Model page.
Child interfaces:
AppointmentCompose
AppointmentRead
Office.AppointmentCompose The appointment organizer mode of Office.context.mailbox.item.
Important: This is an internal Outlook object, not directly
exposed through existing interfaces. You should treat this as a
mode of Office.context.mailbox.item . For more information,
refer to the Object Model page.
Parent interfaces:
ItemCompose
Appointment
Office.AppointmentForm The AppointmentForm object is used to access the currently
selected appointment.
Office.AppointmentRead The appointment attendee mode of Office.context.mailbox.item.
Important: This is an internal Outlook object, not directly
exposed through existing interfaces. You should treat this as a
mode of Office.context.mailbox.item . For more information,
refer to the Object Model page.
Parent interfaces:
ItemRead
Appointment
Office.AppointmentTime Provides the current dates and times of the appointment that
ChangedEventArgs raised the Office.EventType.AppointmentTimeChanged event.
Office.AttachmentContent Represents the content of an attachment on a message or
appointment item.
Office.AttachmentDetails Represents an attachment on an item from the server. Read
mode only.
An array of AttachmentDetails objects is returned as the
attachments property of an appointment or message item.
Office.AttachmentDetails Represents an attachment on an item. Compose mode only.
Compose
An array of AttachmentDetailsCompose objects is returned as the
attachments property of an appointment or message item.
Office.AttachmentsChanged Provides information about the attachments that raised the
EventArgs Office.EventType.AttachmentsChanged event.
Office.Body The body object provides methods for adding and updating the
content of the message or appointment. It is returned in the
body property of the selected item.
Office.Categories Represents the categories on an item.
In Outlook, a user can tag messages and appointments by using
a category to color-code them. The user defines categories in a
master list on their mailbox. They can then apply one or more
categories to an item.
Important: In Outlook on the web, you can't use the API to
manage categories applied to a message in Compose mode.
Office.CategoryDetails Represents a category's details like name and associated color.
Office.CoercionTypeOptions Provides an option for the data format.
Office.Contact Represents the details about a contact (similar to what's on a
physical contact or business card) extracted from the item's
body. Read mode only.
The list of contacts extracted from the body of an email message
or appointment is returned in the contacts property of the
Entities object returned by the getEntities or
getEntitiesByType method of the current item.
Office.CustomProperties The CustomProperties object represents custom properties that
are specific to a particular mail item and specific to an Outlook
add-in. For example, there might be a need for an add-in to save
some data that's specific to the current message that activated
the add-in. If the user revisits the same message in the future
and activates the add-in again, the add-in will be able to retrieve
the data that had been saved as custom properties.
To learn more about CustomProperties , see Get and set add-in
metadata for an Outlook add-in.
Office.DelayDeliveryTime The DelayDeliveryTime object enables you to manage the
delayed delivery date and time of a message.
Office.Diagnostics Provides diagnostic information to an Outlook add-in.
Office.EmailAddressDetails Provides the email properties of the sender or specified
recipients of an email message or appointment.
Office.EmailUser Represents an email account on an Exchange Server.
EmailUser objects are primarily received in MeetingSuggestion
and TaskSuggestion entities extracted from an Outlook item. To
learn more about this scenario, refer to Extract entity strings
from an Outlook item.
Office.EnhancedLocation Represents the set of locations on an appointment.
Office.EnhancedLocations Provides the current enhanced locations when the
ChangedEventArgs Office.EventType.EnhancedLocationsChanged event is raised.
Office.Entities Represents a collection of entities found in an email message or
appointment. Read mode only.
The Entities object is a container for the entity arrays returned
by the getEntities and getEntitiesByType methods when the
item (either an email message or an appointment) contains one
or more entities that have been found by the server. You can use
these entities in your code to provide additional context
information to the viewer, such as a map to an address found in
the item, or to open a dialer for a phone number found in the
item.
If no entities of the type specified in the property are present in
the item, the property associated with that entity is null. For
example, if a message contains a street address and a phone
number, the addresses property and phoneNumbers property
would contain information, and the other properties would be
null.
To be recognized as an address, the string must contain a United
States postal address that has at least a subset of the elements
of a street number, street name, city, state, and zip code.
To be recognized as a phone number, the string must contain a
North American phone number format.
Entity recognition relies on natural language recognition that is
based on machine learning of large amounts of data. The
recognition of an entity is non-deterministic and success
sometimes relies on the particular context in the item.
When the property arrays are returned by the getEntitiesByType
method, only the property for the specified entity contains data;
all other properties are null.
Office.From Provides a method to get the from value of a message in an
Outlook add-in.
Office.InfobarClickedEvent Provides basic details about the notification message that raised
Args the Office.EventType.InfobarClicked event.
Office.InfobarDetails Provides additional details about the notification message that
raised the Office.EventType.InfobarClicked event.
Office.InternetHeaders The InternetHeaders object represents custom internet headers
that are preserved after the message item leaves Exchange and is
converted to a MIME message. These headers are stored as x-
headers in the MIME message.
Internet headers are stored as string key-value pairs on a per-
item basis.
Note: This object is intended for you to set and get your custom
headers on a message item. To learn more, see Get and set
internet headers on a message in an Outlook add-in.
Office.Item The item namespace is used to access the currently selected
message, meeting request, or appointment. You can determine
the type of the item by using the itemType property.
To see the full member list, refer to the Object Model page.
If you want to see IntelliSense for only a specific type or mode,
cast this item to one of the following:
AppointmentCompose
AppointmentRead
MessageCompose
MessageRead
Office.ItemCompose The compose mode of Office.context.mailbox.item.
Important: This is an internal Outlook object, not directly
exposed through existing interfaces. You should treat this as a
mode of Office.context.mailbox.item . For more information,
refer to the Object Model page.
Child interfaces:
AppointmentCompose
MessageCompose
Office.ItemRead The read mode of Office.context.mailbox.item.
Important: This is an internal Outlook object, not directly
exposed through existing interfaces. You should treat this as a
mode of Office.context.mailbox.item . For more information,
refer to the Object Model page.
Child interfaces:
AppointmentRead
MessageRead
Office.LocalClientTime Represents a date and time in the local client's time zone. Read
mode only.
Office.Location Provides methods to get and set the location of a meeting in an
Outlook add-in.
Office.LocationDetails Represents a location. Read-only.
Office.LocationIdentifier Represents the ID of a location.
Office.Mailbox Provides access to the Microsoft Outlook add-in object model.
Key properties:
diagnostics : Provides diagnostic information to an
Outlook add-in.
item : Provides methods and properties for accessing a
message or appointment in an Outlook add-in.
userProfile : Provides information about the user in an
Outlook add-in.
Office.MasterCategories Represents the categories master list on the mailbox.
In Outlook, a user can tag messages and appointments by using
a category to color-code them. The user defines categories in a
master list on their mailbox. They can then apply one or more
categories to an item.
Important: In delegate or shared scenarios, the delegate can get
the categories in the master list but can't add or remove
categories.
Office.MeetingSuggestion Represents a suggested meeting found in an item. Read mode
only.
The list of meetings suggested in an email message is returned
in the meetingSuggestions property of the Entities object that
is returned when the getEntities or getEntitiesByType method
is called on the active item.
The start and end values are string representations of a Date
object that contains the date and time at which the suggested
meeting is to begin and end. The values are in the default time
zone specified for the current user.
Office.Message A subclass of Item for messages.
Important: This is an internal Outlook object, not directly
exposed through existing interfaces. You should treat this as a
mode of Office.context.mailbox.item . For more information,
refer to the Object Model page.
Child interfaces:
MessageCompose
MessageRead
Office.MessageCompose The message compose mode of Office.context.mailbox.item.
Important: This is an internal Outlook object, not directly
exposed through existing interfaces. You should treat this as a
mode of Office.context.mailbox.item . For more information,
refer to the Object Model page.
Parent interfaces:
ItemCompose
Message
Office.MessageRead The message read mode of Office.context.mailbox.item.
Important: This is an internal Outlook object, not directly
exposed through existing interfaces. You should treat this as a
mode of Office.context.mailbox.item . For more information,
refer to the Object Model page.
Parent interfaces:
ItemRead
Message
Office.NotificationMessage The definition of the action for a notification message.
Action
Important: In modern Outlook on the web, the
NotificationMessageAction object is available in Compose mode
only.
Office.NotificationMessage An array of NotificationMessageDetails objects are returned by
Details the NotificationMessages.getAllAsync method.
Office.NotificationMessages The NotificationMessages object is returned as the
notificationMessages property of an item.
Office.Organizer Represents the appointment organizer, even if an alias or a
delegate was used to create the appointment. This object
provides a method to get the organizer value of an appointment
in an Outlook add-in.
Office.PhoneNumber Represents a phone number identified in an item. Read mode
only.
An array of PhoneNumber objects containing the phone numbers
found in an email message is returned in the phoneNumbers
property of the Entities object that is returned when you call
the getEntities method on the selected item.
Office.Recipients Represents recipients of an item. Compose mode only.
Office.RecipientsChanged Provides change status of recipients fields when the
EventArgs Office.EventType.RecipientsChanged event is raised.
Office.RecipientsChanged Represents RecipientsChangedEventArgs.changedRecipientFields
Fields object.
Office.Recurrence The Recurrence object provides methods to get and set the
recurrence pattern of appointments but only get the recurrence
pattern of meeting requests. It will have a dictionary with the
following keys: seriesTime , recurrenceType ,
recurrenceProperties , and recurrenceTimeZone (optional).
Office.RecurrenceChanged Provides updated recurrence object that raised the
EventArgs Office.EventType.RecurrenceChanged event.
Office.RecurrenceProperties Represents the properties of the recurrence.
Office.RecurrenceTimeZone Represents the time zone of the recurrence.
Office.ReplyFormAttachment A file or item attachment. Used when displaying a reply form.
Office.ReplyFormData A ReplyFormData object that contains body or attachment data
and a callback function. Used when displaying a reply form.
Office.RoamingSettings The settings created by using the methods of the
RoamingSettings object are saved per add-in and per user. That
is, they are available only to the add-in that created them, and
only from the user's mailbox in which they are saved.
While the Outlook add-in API limits access to these settings to
only the add-in that created them, these settings shouldn't be
considered secure storage. They can be accessed by Exchange
Web Services or Extended MAPI. They shouldn't be used to store
sensitive information, such as user credentials or security tokens.
The name of a setting is a String, while the value can be a String,
Number, Boolean, null, Object, or Array.
The RoamingSettings object is accessible via the roamingSettings
property in the Office.context namespace.
To learn more about RoamingSettings , see Get and set add-in
metadata for an Outlook add-in.
Office.SensitivityLabel Provides methods to get or set the sensitivity label of a message
or appointment. For more information on sensitivity labels, see
Learn about sensitivity labels.
Office.SensitivityLabel Provides the change status of the sensitivity label applied to a
ChangedEventArgs message or appointment in compose mode. This information is
provided when the Office.EventType.SensitivityLabelChanged
event is raised.
Office.SensitivityLabelDetails Represents the properties of available sensitivity labels in
Outlook.
Office.SensitivityLabelsCatalog Provides methods to check the status of the catalog of sensitivity
labels in Outlook and retrieve all available sensitivity labels if the
catalog is enabled.
Office.SeriesTime The SeriesTime object provides methods to get and set the
dates and times of appointments in a recurring series and get
the dates and times of meeting requests in a recurring series.
Office.SessionData Provides methods to manage an item's session data.
Important: The entire SessionData object is limited to 50,000
characters per add-in.
Office.SharedProperties Represents the properties of an appointment or message in a
shared folder or shared mailbox.
For more information on how this object is used, see Enable
shared folders and shared mailbox scenarios in an Outlook add-
in.
Office.Subject Provides methods to get and set the subject of an appointment
or message in an Outlook add-in.
Office.TaskSuggestion Represents a suggested task identified in an item. Read mode
only.
The list of tasks suggested in an email message is returned in the
taskSuggestions property of the Entities object that is returned
when the getEntities or getEntitiesByType method is called on
the active item.
Office.Time The Time object is returned as the start or end property of an
appointment in compose mode.
Office.UserProfile Information about the user associated with the mailbox. This
includes their account type, display name, email address, and
time zone.
Enums
Office.MailboxEnums.Action Specifies the type of custom action in a notification message.
Type
Office.MailboxEnums. Specifies the formatting that applies to an attachment's content.
AttachmentContentFormat
Office.MailboxEnums. Specifies whether an attachment was added to or removed from
AttachmentStatus an item.
Office.MailboxEnums. Specifies an attachment's type.
AttachmentType
Office.MailboxEnums. Specifies the category color.
CategoryColor
Note: The actual color depends on how the Outlook client
renders it. In this case, the colors noted on each preset are for
the Outlook desktop client.
Office.MailboxEnums. Specifies a message's compose type.
ComposeType
Office.MailboxEnums.Days Specifies the day of week or type of day.
Office.MailboxEnums. This bitmask represents a delegate's permissions on a shared
DelegatePermissions folder.
Office.MailboxEnums.Entity Specifies an entity's type.
Type
Office.MailboxEnums.Infobar Action types supported by Office.EventType.InfobarClicked.
ActionType
Office.MailboxEnums.Infobar Type of notification allowed by Office.EventType.InfobarClicked.
Type
Office.MailboxEnums.Item Specifies the notification message type for an appointment or
NotificationMessageType message.
Office.MailboxEnums.Item Specifies an item's type.
Type
Office.MailboxEnums.Location Specifies an appointment location's type.
Type
Office.MailboxEnums.Month Specifies the month.
Office.MailboxEnums. Represents the current view of Outlook on the web.
OWAView
Office.MailboxEnums. Specifies the type of recipient of a message or appointment.
RecipientType
Office.MailboxEnums. Specifies the time zone applied to the recurrence.
RecurrenceTimeZone
Office.MailboxEnums. Specifies the type of recurrence.
RecurrenceType
Office.MailboxEnums. Specifies the type of response to a meeting invitation.
ResponseType
Office.MailboxEnums.Rest Specifies the version of the REST API that corresponds to a REST-
Version formatted item ID.
Office.MailboxEnums.Source Specifies the source of the selected data in an item (see
Property Office.mailbox.item.getSelectedDataAsync for details).
Office.MailboxEnums.Week Specifies the week of the month.
Number
Office.MailboxEnums.ActionType enum
Reference
Package: outlook
Specifies the type of custom action in a notification message.
Remarks
[ API set: Mailbox 1.10 ]
Examples
TypeScript
// Define an insight notification message.
const insightMessage = {
type: Office.MailboxEnums.ItemNotificationMessageType.InsightMessage,
message: "This is an insight notification",
icon: "Icon.80x80",
actions: [{
actionText: "Open insight",
actionType: Office.MailboxEnums.ActionType.ShowTaskPane,
commandId: "msgComposeOpenPaneButton",
contextData: JSON.stringify({a: "aValue", b: "bValue"})
}]
};
Fields
ShowTaskPane = The showTaskPane action.
"showTaskPane"
Office.MailboxEnums.Attachment
ContentFormat enum
Reference
Package: outlook
Specifies the formatting that applies to an attachment's content.
Remarks
[ API set: Mailbox 1.8 ]
Applicable Outlook mode: Compose or Read
Examples
TypeScript
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-
js-snippets/prod/samples/outlook/40-attachments/get-attachment-content.yaml
function handleAttachmentsCallback(result) {
// Identifies whether the attachment is a Base64-encoded string, .eml
file, .icalendar file, or a URL.
switch (result.value.format) {
case Office.MailboxEnums.AttachmentContentFormat.Base64:
// Handle file attachment.
console.log("Attachment is a Base64-encoded string.");
break;
case Office.MailboxEnums.AttachmentContentFormat.Eml:
// Handle email item attachment.
console.log("Attachment is a message.");
break;
case Office.MailboxEnums.AttachmentContentFormat.ICalendar:
// Handle .icalender attachment.
console.log("Attachment is a calendar item.");
break;
case Office.MailboxEnums.AttachmentContentFormat.Url:
// Handle cloud attachment.
console.log("Attachment is a cloud attachment.");
break;
default:
// Handle attachment formats that aren't supported.
}
console.log(result.value.content);
}
Fields
Base64 = "base64" The content of the attachment is returned as a base64-encoded
string.
Eml = "eml" The content of the attachment is returned as a string
representing an .eml formatted file.
ICalendar = "iCalendar" The content of the attachment is returned as a string
representing an .icalendar formatted file.
Url = "url" The content of the attachment is returned as a string
representing a URL.
Office.MailboxEnums.AttachmentStatus
enum
Reference
Package: outlook
Specifies whether an attachment was added to or removed from an item.
Remarks
[ API set: Mailbox 1.8 ]
Applicable Outlook mode: Compose or Read
Examples
TypeScript
// Get the attachment that was just added to a message or appointment.
function myHandlerFunction(eventarg) {
if (eventarg.attachmentStatus ===
Office.MailboxEnums.AttachmentStatus.Added) {
const attachment = eventarg.attachmentDetails;
console.log("Event Fired and Attachment Added!");
getAttachmentContentAsync(attachment.id, options, callback);
}
}
Office.context.mailbox.item.addHandlerAsync(Office.EventType.AttachmentsChan
ged, myHandlerFunction, myCallback);
Fields
Added = "added" An attachment was added to the item.
Removed = "removed" An attachment was removed from the item.
Office.MailboxEnums.AttachmentType
enum
Reference
Package: outlook
Specifies an attachment's type.
Remarks
Applicable Outlook mode: Compose or Read
Examples
TypeScript
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-
js-snippets/prod/samples/outlook/40-attachments/attachments-compose.yaml
Office.context.mailbox.item.getAttachmentsAsync(function (result) {
if (result.status !== Office.AsyncResultStatus.Succeeded) {
console.error(result.error.message);
} else {
if (result.value.length > 0) {
for (let i = 0; i < result.value.length; i++) {
const attachment = result.value[i];
console.log("ID: " + attachment.id + "\n" +
"Name: " + attachment.name + "\n" +
"Size: " + attachment.size + "\n" +
"isInline: " + attachment.isInline);
switch (attachment.attachmentType) {
case Office.MailboxEnums.AttachmentType.Cloud:
console.log("Attachment type: Attachment is stored
in a cloud location.");
break;
case Office.MailboxEnums.AttachmentType.File:
console.log("Attachment type: Attachment is a
file.");
break;
case Office.MailboxEnums.AttachmentType.Item:
console.log("Attachment type: Attachment is an
Exchange item.");
break;
}
}
}
else {
console.log("No attachments on this message.");
}
}
});
Fields
Cloud = "cloud" The attachment is stored in a cloud location, such as OneDrive.
Important: In Read mode, the id property of the attachment's
details object contains a URL to the file. From requirement set
1.8, the url property included in the attachment's details object
contains a URL to the file in Compose mode.
File = "file" The attachment is a file.
Item = "item" The attachment is an Exchange item.
Office.MailboxEnums.CategoryColor
enum
Reference
Package: outlook
Specifies the category color.
Note: The actual color depends on how the Outlook client renders it. In this case, the
colors noted on each preset are for the Outlook desktop client.
Remarks
[ API set: Mailbox 1.8 ]
Applicable Outlook mode: Compose or Read
Examples
TypeScript
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-
js-snippets/prod/samples/outlook/45-categories/work-with-master-
categories.yaml
const masterCategoriesToAdd = [
{
displayName: "TestCategory",
color: Office.MailboxEnums.CategoryColor.Preset0
}
];
Office.context.mailbox.masterCategories.addAsync(masterCategoriesToAdd,
function(asyncResult) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
console.log("Successfully added categories to master list");
} else {
console.log("masterCategories.addAsync call failed with error: " +
asyncResult.error.message);
}
});
Fields
None Default color or no color mapped.
Preset0 Red
Preset1 Orange
Preset10 Steel
Preset11 DarkSteel
Preset12 Gray
Preset13 DarkGray
Preset14 Black
Preset15 DarkRed
Preset16 DarkOrange
Preset17 DarkBrown
Preset18 DarkYellow
Preset19 DarkGreen
Preset2 Brown
Preset20 DarkTeal
Preset21 DarkOlive
Preset22 DarkBlue
Preset23 DarkPurple
Preset24 DarkCranberry
Preset3 Yellow
Preset4 Green
Preset5 Teal
Preset6 Olive
Preset7 Blue
Preset8 Purple
Preset9 Cranberry
Office.MailboxEnums.ComposeType
enum
Reference
Package: outlook
Specifies a message's compose type.
Remarks
[ API set: Mailbox 1.10 ]
Applicable Outlook mode: Compose
Examples
TypeScript
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-
js-snippets/prod/samples/outlook/90-other-item-apis/work-with-client-
signatures.yaml
// Get the compose type of the current message.
Office.context.mailbox.item.getComposeTypeAsync(function(asyncResult) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
console.log(
"getComposeTypeAsync succeeded with composeType: " +
asyncResult.value.composeType +
" and coercionType: " +
asyncResult.value.coercionType
);
} else {
console.error(asyncResult.error);
}
});
Fields
Forward = "forward" Forward.
NewMail = "newMail" New mail.
Reply = "reply" Reply.
Office.MailboxEnums.Days enum
Reference
Package: outlook
Specifies the day of week or type of day.
Remarks
[ API set: Mailbox 1.7 ]
Applicable Outlook mode: Compose or Read
Examples
TypeScript
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-
js-snippets/prod/samples/outlook/50-recurrence/get-set-recurrence-
appointment-organizer.yaml
// Important: Can only set the recurrence pattern of an appointment series.
const currentDate = new Date();
let seriesTimeObject: Office.SeriesTime;
// Set series start date to tomorrow.
seriesTimeObject.setStartDate(currentDate.getFullYear(),
currentDate.getMonth(), currentDate.getDay() + 1);
// Set series end date to one year from now.
seriesTimeObject.setEndDate(currentDate.getFullYear() + 1,
currentDate.getMonth() + 1, currentDate.getDay());
// Set start time to 1:30 PM.
seriesTimeObject.setStartTime(13, 30);
// Set duration to 30 minutes.
seriesTimeObject.setDuration(30);
const pattern: Office.Recurrence = {
seriesTime: seriesTimeObject,
recurrenceType: Office.MailboxEnums.RecurrenceType.Yearly,
recurrenceProperties: {
interval: 1,
dayOfWeek: Office.MailboxEnums.Days.Tue,
weekNumber: Office.MailboxEnums.WeekNumber.Second,
month: Office.MailboxEnums.Month.Sep
},
recurrenceTimeZone: { name:
Office.MailboxEnums.RecurrenceTimeZone.PacificStandardTime }
};
Office.context.mailbox.item.recurrence.setAsync(pattern, (asyncResult) => {
if (asyncResult.status !== Office.AsyncResultStatus.Succeeded) {
console.error(`Failed to set recurrence. Error:
${asyncResult.error.message}`);
return;
}
console.log(`Succeeded in setting recurrence pattern
${JSON.stringify(pattern)}`);
});
Fields
Day = "day" Day of week.
Fri = "fri" Friday
Mon = "mon" Monday
Sat = "sat" Saturday
Sun = "sun" Sunday
Thu = "thu" Thursday
Tue = "tue" Tuesday
Wed = "wed" Wednesday
Weekday = "weekday" Week day (excludes weekend days): 'Mon', 'Tue', 'Wed', 'Thu',
and 'Fri'.
WeekendDay = Weekend day: 'Sat' and 'Sun'.
"weekendDay"
Office.MailboxEnums.Delegate
Permissions enum
Reference
Package: outlook
This bitmask represents a delegate's permissions on a shared folder.
Remarks
[ API set: Mailbox 1.8 ]
Applicable Outlook mode: Compose or Read
Examples
TypeScript
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-
js-snippets/prod/samples/outlook/65-delegates-and-shared-folders/get-shared-
properties.yaml
if (!Office.context.mailbox.item.getSharedPropertiesAsync) {
console.error("Try this sample on an appointment from a shared folder.");
return;
}
Office.context.mailbox.getCallbackTokenAsync({ isRest: true },
function(result) {
if (result.status === Office.AsyncResultStatus.Succeeded && result.value
!== "") {
Office.context.mailbox.item.getSharedPropertiesAsync(
{
// Pass auth token along.
asyncContext: result.value
},
function(result2) {
let sharedProperties = result2.value;
let delegatePermissions = sharedProperties.delegatePermissions;
// Determine if user has the appropriate permission to do the
operation.
if ((delegatePermissions &
Office.MailboxEnums.DelegatePermissions.Read) != 0) {
const ewsId = Office.context.mailbox.item.itemId;
const restId = Office.context.mailbox.convertToRestId(ewsId,
Office.MailboxEnums.RestVersion.v2_0);
let rest_url =
sharedProperties.targetRestUrl + "/v2.0/users/" +
sharedProperties.targetMailbox + "/events/" + restId;
$.ajax({
url: rest_url,
dataType: "json",
headers: { Authorization: "Bearer " + result2.asyncContext }
})
.done(function(response) {
console.log(response);
})
.fail(function(error) {
console.error(error);
});
}
}
);
}
});
Fields
DeleteAll = 8 Delegate has permission to delete any items.
DeleteOwn = 4 Delegate has permission to delete only the items they created.
EditAll = 32 Delegate has permission to edit any items.
EditOwn = 16 Delegate has permission to edit only they items they created.
Read = 1 Delegate has permission to read items.
Write = 2 Delegate has permission to create and write items.
Office.MailboxEnums.EntityType enum
Reference
Package: outlook
Specifies an entity's type.
Remarks
Applicable Outlook mode: Compose or Read
Examples
TypeScript
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-
js-snippets/prod/samples/outlook/75-entities-and-regex-matches/basic-
entities.yaml
console.log(Office.context.mailbox.item.getEntitiesByType(Office.MailboxEnum
s.EntityType.Address));
Fields
Address = "address" Specifies that the entity is a postal address.
Contact = "contact" Specifies that the entity is a contact.
EmailAddress = Specifies that the entity is an SMTP email address.
"emailAddress"
MeetingSuggestion = Specifies that the entity is a meeting suggestion.
"meetingSuggestion"
PhoneNumber = Specifies that the entity is a US phone number.
"phoneNumber"
TaskSuggestion = Specifies that the entity is a task suggestion.
"taskSuggestion"
Url = "url" Specifies that the entity is an Internet URL.
Office.MailboxEnums.InfobarActionType
enum
Reference
Package: outlook
Action types supported by Office.EventType.InfobarClicked.
Remarks
[ API set: Mailbox 1.10 ]
Examples
TypeScript
/*
* This snippet activates when a notification message is dismissed from an
Outlook message or appointment.
* The event handler logs the custom action and notification type to the
console.
*/
Office.context.mailbox.item.addHandlerAsync(Office.EventType.InfobarClicked,
eventHandler, callback);
function eventHandler(event) {
const infobarDetails = event.infobarDetails;
// Log the custom action type.
console.log(`Custom action type: ${infobarDetails.actionType}`);
// Log the notification type.
switch (infobarDetails.infobarType) {
case Office.MailboxEnums.InfobarType.Error:
console.log("Notification type: Error message");
break;
case Office.MailboxEnums.InfobarType.Informational:
console.log("Notification type: Informational message");
break;
case Office.MailboxEnums.InfobarType.Insight:
console.log("Notification type: Informational message with
available actions from the task pane");
break;
case Office.MailboxEnums.InfobarType.ProgressIndicator:
console.log("Notification type: Progress indicator");
break;
}
}
Fields
Dismiss = 1 Dismiss action was selected.
[ API set: Mailbox 1.10 ]
Office.MailboxEnums.InfobarType enum
Reference
Package: outlook
Type of notification allowed by Office.EventType.InfobarClicked.
Remarks
[ API set: Mailbox 1.10 ]
Examples
TypeScript
/*
* This snippet activates when a notification message is dismissed from an
Outlook message or appointment.
* The event handler logs the custom action and notification type to the
console.
*/
Office.context.mailbox.item.addHandlerAsync(Office.EventType.InfobarClicked,
eventHandler, callback);
function eventHandler(event) {
const infobarDetails = event.infobarDetails;
// Log the custom action type.
console.log(`Custom action type: ${infobarDetails.actionType}`);
// Log the notification type.
switch (infobarDetails.infobarType) {
case Office.MailboxEnums.InfobarType.Error:
console.log("Notification type: Error message");
break;
case Office.MailboxEnums.InfobarType.Informational:
console.log("Notification type: Informational message");
break;
case Office.MailboxEnums.InfobarType.Insight:
console.log("Notification type: Informational message with
available actions from the task pane");
break;
case Office.MailboxEnums.InfobarType.ProgressIndicator:
console.log("Notification type: Progress indicator");
break;
}
}
Fields
Error = 2 Notification displays an error message.
[ API set: Mailbox 1.10 ]
Informational = 0 Notification displays an informational message.
[ API set: Mailbox 1.10 ]
Insight = 3 Notification displays an informational message with actions.
[ API set: Mailbox 1.10 ]
ProgressIndicator = 1 Notification displays a progress indicator.
[ API set: Mailbox 1.10 ]
Office.MailboxEnums.ItemNotification
MessageType enum
Reference
Package: outlook
Specifies the notification message type for an appointment or message.
Remarks
[ API set: Mailbox 1.3 ]
Applicable Outlook mode: Compose or Read
Examples
TypeScript
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-
js-snippets/prod/samples/outlook/35-notifications/add-getall-remove.yaml
const id = $("#notificationId").val();
const details =
{
type: Office.MailboxEnums.ItemNotificationMessageType.ErrorMessage,
message: "Error notification message with id = " + id
};
Office.context.mailbox.item.notificationMessages.addAsync(id, details,
handleResult);
Fields
ErrorMessage = The notification message is an error message.
"errorMessage"
InformationalMessage = The notification message is an informational message.
"informationalMessage"
InsightMessage = The notification message is an informational message with
"insightMessage" actions.
[ API set: Mailbox 1.10 ]
ProgressIndicator = The notification message is a progress indicator.
"progressIndicator"
Office.MailboxEnums.ItemType enum
Reference
Package: outlook
Specifies an item's type.
Remarks
Applicable Outlook mode: Compose or Read
Examples
TypeScript
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-
js-snippets/prod/samples/outlook/90-other-item-apis/get-item-type.yaml
const itemType = Office.context.mailbox.item.itemType;
switch (itemType) {
case Office.MailboxEnums.ItemType.Appointment:
console.log(`Current item is an ${itemType}.`);
break;
case Office.MailboxEnums.ItemType.Message:
console.log(`Current item is a ${itemType}. A message could be an
email, meeting request, meeting response, or meeting cancellation.`);
break;
}
Fields
Appointment = An appointment item.
"appointment"
Message = "message" An email, meeting request, meeting response, or meeting
cancellation.
Office.MailboxEnums.LocationType
enum
Reference
Package: outlook
Specifies an appointment location's type.
Remarks
[ API set: Mailbox 1.8 ]
Applicable Outlook mode: Compose or Read
Examples
TypeScript
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-
js-snippets/prod/samples/outlook/90-other-item-apis/get-add-remove-
enhancedlocation-appointment.yaml
const locations = [
{
id: "Contoso",
type: Office.MailboxEnums.LocationType.Custom
},
{
id: "
[email protected]",
type: Office.MailboxEnums.LocationType.Room
}
];
Office.context.mailbox.item.enhancedLocation.addAsync(locations, (result) =>
{
if (result.status === Office.AsyncResultStatus.Succeeded) {
console.log(`Successfully added locations
${JSON.stringify(locations)}`);
} else {
console.error(`Failed to add locations. Error message:
${result.error.message}`);
}
});
Fields
Custom = "custom" A custom location. Custom locations don't have an SMTP
address.
Note: Personal contact groups added as appointment
locations aren't returned by the EnhancedLocation.getAsync
method.
Room = "room" A conference room or similar resource that has an SMTP address.
Office.MailboxEnums.Month enum
Reference
Package: outlook
Specifies the month.
Remarks
[ API set: Mailbox 1.7 ]
Applicable Outlook mode: Compose or Read
Examples
TypeScript
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-
js-snippets/prod/samples/outlook/50-recurrence/get-set-recurrence-
appointment-organizer.yaml
// Important: Can only set the recurrence pattern of an appointment series.
const currentDate = new Date();
let seriesTimeObject: Office.SeriesTime;
// Set series start date to tomorrow.
seriesTimeObject.setStartDate(currentDate.getFullYear(),
currentDate.getMonth(), currentDate.getDay() + 1);
// Set series end date to one year from now.
seriesTimeObject.setEndDate(currentDate.getFullYear() + 1,
currentDate.getMonth() + 1, currentDate.getDay());
// Set start time to 1:30 PM.
seriesTimeObject.setStartTime(13, 30);
// Set duration to 30 minutes.
seriesTimeObject.setDuration(30);
const pattern: Office.Recurrence = {
seriesTime: seriesTimeObject,
recurrenceType: Office.MailboxEnums.RecurrenceType.Yearly,
recurrenceProperties: {
interval: 1,
dayOfWeek: Office.MailboxEnums.Days.Tue,
weekNumber: Office.MailboxEnums.WeekNumber.Second,
month: Office.MailboxEnums.Month.Sep
},
recurrenceTimeZone: { name:
Office.MailboxEnums.RecurrenceTimeZone.PacificStandardTime }
};
Office.context.mailbox.item.recurrence.setAsync(pattern, (asyncResult) => {
if (asyncResult.status !== Office.AsyncResultStatus.Succeeded) {
console.error(`Failed to set recurrence. Error:
${asyncResult.error.message}`);
return;
}
console.log(`Succeeded in setting recurrence pattern
${JSON.stringify(pattern)}`);
});
Fields
Apr = "apr" April
Aug = "aug" August
Dec = "dec" December
Feb = "feb" February
Jan = "jan" January
Jul = "jul" July
Jun = "jun" June
Mar = "mar" March
May = "may" May
Nov = "nov" November
Oct = "oct" October
Sep = "sep" September
Office.MailboxEnums.OWAView enum
Reference
Package: outlook
Represents the current view of Outlook on the web.
Remarks
Examples
TypeScript
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-
js-snippets/prod/samples/outlook/90-other-item-apis/get-diagnostic-
information.yaml
// This function gets a mailbox's diagnostic information, such as Outlook
client and version, and logs it to the console.
const diagnostics = Office.context.mailbox.diagnostics;
console.log(`Client application: ${diagnostics.hostName}`);
console.log(`Client version: ${diagnostics.hostVersion}`);
switch (diagnostics.OWAView) {
case undefined:
console.log("Current view (Outlook on the web only): Not applicable. An
Outlook desktop client is in use.");
break;
case Office.MailboxEnums.OWAView.OneColumnNarrow:
console.log("Current view (Outlook on the web only): Viewed from an
older generation mobile phone");
break;
case Office.MailboxEnums.OWAView.OneColumn:
console.log("Current view (Outlook on the web only): Viewed from a newer
generation mobile phone");
break;
case Office.MailboxEnums.OWAView.TwoColumns:
console.log("Current view (Outlook on the web only): Viewed from a
tablet");
break;
case Office.MailboxEnums.OWAView.ThreeColumns:
console.log("Current view (Outlook on the web only): Viewed from a
desktop computer");
break;
}
Fields
OneColumn = "OneColumn" One-column view. Displayed when the screen width is greater
than or equal to 436 pixels, but less than 536 pixels. For example,
Outlook on the web uses this view on the entire screen of newer
smartphones.
OneColumnNarrow = Narrow one-column view. Displayed when the screen width is
"OneColumnNarrow" less than 436 pixels. For example, Outlook on the web uses this
view on the entire screen of older smartphones.
ThreeColumns = Three-column view. Displayed when the screen width is greater
"ThreeColumns" than or equal to 780 pixels. For example, Outlook on the web
uses this view in a full screen window on a desktop computer.
TwoColumns = "TwoColumns" Two-column view. Displayed when the screen width is greater
than or equal to 536 pixels, but less than 780 pixels. For example,
Outlook on the web uses this view on most tablets.
Office.MailboxEnums.RecipientType
enum
Reference
Package: outlook
Specifies the type of recipient of a message or appointment.
Remarks
[ API set: Mailbox 1.1 ]
Applicable Outlook mode: Compose or Read
Important: A recipientType property value isn't returned by the
Office.context.mailbox.item.from.getAsync and
Office.context.mailbox.item.organizer.getAsync methods. The email sender or
appointment organizer is always a user whose email address is on the Exchange server.
Examples
TypeScript
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-
js-snippets/prod/samples/outlook/30-recipients-and-attendees/get-to-message-
read.yaml
const msgTo = Office.context.mailbox.item.to;
const distributionLists = [];
const externalRecipients = [];
const internalRecipients = [];
const otherRecipients = [];
for (let i = 0; i < msgTo.length; i++) {
switch (msgTo[i].recipientType) {
case Office.MailboxEnums.RecipientType.DistributionList:
distributionLists.push(msgTo[i]);
break;
case Office.MailboxEnums.RecipientType.ExternalUser:
externalRecipients.push(msgTo[i]);
break;
case Office.MailboxEnums.RecipientType.User:
internalRecipients.push(msgTo[i]);
break;
case Office.MailboxEnums.RecipientType.Other:
otherRecipients.push(msgTo[i]);
}
}
if (distributionLists.length > 0) {
console.log("Distribution Lists:");
distributionLists.forEach((recipient) =>
console.log(`${recipient.displayName}, ${recipient.emailAddress}`));
}
if (externalRecipients.length > 0) {
console.log("External Recipients:");
externalRecipients.forEach((recipient) =>
console.log(`${recipient.displayName}, ${recipient.emailAddress}`));
}
if (internalRecipients.length > 0) {
console.log("Internal Recipients:");
internalRecipients.forEach((recipient) =>
console.log(`${recipient.displayName}, ${recipient.emailAddress}`));
}
if (otherRecipients.length > 0) {
console.log("Other Recipients:");
otherRecipients.forEach((recipient) =>
console.log(`${recipient.displayName}, ${recipient.emailAddress}`));
}
Fields
DistributionList = Specifies the recipient is a distribution list containing a list of
"distributionList" email addresses.
ExternalUser = "externalUser" Specifies the recipient is an SMTP email address that isn't on the
Exchange server. It also refers to a recipient added from a
personal Outlook address book.
Important: In Outlook on Windows (starting with Version 2210
(Build 15813.20002)), on Mac, and on the web, Global Address
Book (GAL) recipients saved to a personal address book return
the ExternalUser value, even if their SMTP email address
appears on the Exchange server. Recipients return a User value
only if they're directly added or resolved against the GAL.
Other = "other" Specifies the recipient isn't one of the other recipient types. It
also refers to a recipient that isn't resolved against the Exchange
address book, and is therefore treated as an external SMTP
address.
Important: In Outlook on Android and on iOS, Global Address
Book (GAL) recipients saved to a personal address book return
the Other value, even if their SMTP email address appears on the
Exchange server. Recipients return a User value only if they're
directly added or resolved against the GAL.
User = "user" Specifies the recipient is an SMTP email address on the Exchange
server.
Office.MailboxEnums.RecurrenceTime
Zone enum
Reference
Package: outlook
Specifies the time zone applied to the recurrence.
Remarks
[ API set: Mailbox 1.7 ]
Applicable Outlook mode: Compose or Read
Examples
TypeScript
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-
js-snippets/prod/samples/outlook/50-recurrence/get-set-recurrence-
appointment-organizer.yaml
// Important: Can only set the recurrence pattern of an appointment series.
const currentDate = new Date();
let seriesTimeObject: Office.SeriesTime;
// Set series start date to tomorrow.
seriesTimeObject.setStartDate(currentDate.getFullYear(),
currentDate.getMonth(), currentDate.getDay() + 1);
// Set series end date to one year from now.
seriesTimeObject.setEndDate(currentDate.getFullYear() + 1,
currentDate.getMonth() + 1, currentDate.getDay());
// Set start time to 1:30 PM.
seriesTimeObject.setStartTime(13, 30);
// Set duration to 30 minutes.
seriesTimeObject.setDuration(30);
const pattern: Office.Recurrence = {
seriesTime: seriesTimeObject,
recurrenceType: Office.MailboxEnums.RecurrenceType.Yearly,
recurrenceProperties: {
interval: 1,
dayOfWeek: Office.MailboxEnums.Days.Tue,
weekNumber: Office.MailboxEnums.WeekNumber.Second,
month: Office.MailboxEnums.Month.Sep
},
recurrenceTimeZone: { name:
Office.MailboxEnums.RecurrenceTimeZone.PacificStandardTime }
};
Office.context.mailbox.item.recurrence.setAsync(pattern, (asyncResult) => {
if (asyncResult.status !== Office.AsyncResultStatus.Succeeded) {
console.error(`Failed to set recurrence. Error:
${asyncResult.error.message}`);
return;
}
console.log(`Succeeded in setting recurrence pattern
${JSON.stringify(pattern)}`);
});
Fields
AfghanistanStandardTime = Afghanistan Standard Time
"Afghanistan Standard Time"
AlaskanStandardTime = Alaskan Standard Time
"Alaskan Standard Time"
AleutianStandardTime = Aleutian Standard Time
"Aleutian Standard Time"
AltaiStandardTime = "Altai Altai Standard Time
Standard Time"
ArabianStandardTime = Arabian Standard Time
"Arabian Standard Time"
ArabicStandardTime = "Arabic Arabic Standard Time
Standard Time"
ArabStandardTime = "Arab Arab Standard Time
Standard Time"
ArgentinaStandardTime = Argentina Standard Time
"Argentina Standard Time"
AstrakhanStandardTime = Astrakhan Standard Time
"Astrakhan Standard Time"
AtlanticStandardTime = Atlantic Standard Time
"Atlantic Standard Time"
AUSCentralStandardTime = Australia Central Standard Time
"AUS Central Standard Time"
AusCentralW_StandardTime = Australia Central West Standard Time
"Aus Central W. Standard Time"
AUSEasternStandardTime = AUS Eastern Standard Time
"AUS Eastern Standard Time"
AzerbaijanStandardTime = Azerbaijan Standard Time
"Azerbaijan Standard Time"
AzoresStandardTime = "Azores Azores Standard Time
Standard Time"
BahiaStandardTime = "Bahia Bahia Standard Time
Standard Time"
BangladeshStandardTime = Bangladesh Standard Time
"Bangladesh Standard Time"
BelarusStandardTime = Belarus Standard Time
"Belarus Standard Time"
BougainvilleStandardTime = Bougainville Standard Time
"Bougainville Standard Time"
CanadaCentralStandardTime = Canada Central Standard Time
"Canada Central Standard
Time"
CapeVerdeStandardTime = Cape Verde Standard Time
"Cape Verde Standard Time"
CaucasusStandardTime = Caucasus Standard Time
"Caucasus Standard Time"
CenAustraliaStandardTime = Central Australia Standard Time
"Cen. Australia Standard Time"
CentralAmericaStandardTime = Central America Standard Time
"Central America Standard
Time"
CentralAsiaStandardTime = Central Asia Standard Time
"Central Asia Standard Time"
CentralBrazilianStandardTime = Central Brazilian Standard Time
"Central Brazilian Standard
Time"
CentralEuropeanStandardTime Central European Standard Time
= "Central European Standard
Time"
CentralEuropeStandardTime = Central Europe Standard Time
"Central Europe Standard Time"
CentralPacificStandardTime = Central Pacific Standard Time
"Central Pacific Standard Time"
CentralStandardTime = Central Standard Time
"Central Standard Time"
CentralStandardTime_Mexico = Central Standard Time (Mexico)
"Central Standard Time
(Mexico)"
ChathamIslandsStandardTime Chatham Islands Standard Time
= "Chatham Islands Standard
Time"
ChinaStandardTime = "China China Standard Time
Standard Time"
CubaStandardTime = "Cuba Cuba Standard Time
Standard Time"
DatelineStandardTime = Dateline Standard Time
"Dateline Standard Time"
E_AfricaStandardTime = "E. East Africa Standard Time
Africa Standard Time"
E_AustraliaStandardTime = "E. East Australia Standard Time
Australia Standard Time"
E_EuropeStandardTime = "E. East Europe Standard Time
Europe Standard Time"
E_SouthAmericaStandardTime East South America Standard Time
= "E. South America Standard
Time"
EasterIslandStandardTime = Easter Island Standard Time
"Easter Island Standard Time"
EasternStandardTime = Eastern Standard Time
"Eastern Standard Time"
EasternStandardTime_Mexico = Eastern Standard Time (Mexico)
"Eastern Standard Time
(Mexico)"
EgyptStandardTime = "Egypt Egypt Standard Time
Standard Time"
EkaterinburgStandardTime = Ekaterinburg Standard Time
"Ekaterinburg Standard Time"
FijiStandardTime = "Fiji Fiji Standard Time
Standard Time"
FLEStandardTime = "FLE FLE Standard Time
Standard Time"
GeorgianStandardTime = Georgian Standard Time
"Georgian Standard Time"
GMTStandardTime = "GMT GMT Standard Time
Standard Time"
GreenlandStandardTime = Greenland Standard Time
"Greenland Standard Time"
GreenwichStandardTime = Greenwich Standard Time
"Greenwich Standard Time"
GTBStandardTime = "GTB GTB Standard Time
Standard Time"
HaitiStandardTime = "Haiti Haiti Standard Time
Standard Time"
HawaiianStandardTime = Hawaiian Standard Time
"Hawaiian Standard Time"
IndiaStandardTime = "India India Standard Time
Standard Time"
IranStandardTime = "Iran Iran Standard Time
Standard Time"
IsraelStandardTime = "Israel Israel Standard Time
Standard Time"
JordanStandardTime = "Jordan Jordan Standard Time
Standard Time"
KaliningradStandardTime = Kaliningrad Standard Time
"Kaliningrad Standard Time"
KamchatkaStandardTime = Kamchatka Standard Time
"Kamchatka Standard Time"
KoreaStandardTime = "Korea Korea Standard Time
Standard Time"
LibyaStandardTime = "Libya Libya Standard Time
Standard Time"
LineIslandsStandardTime = Line Islands Standard Time
"Line Islands Standard Time"
LordHoweStandardTime = Lord Howe Standard Time
"Lord Howe Standard Time"
MagadanStandardTime = Magadan Standard Time
"Magadan Standard Time"
MagallanesStandardTime = Magallanes Standard Time
"Magallanes Standard Time"
MarquesasStandardTime = Marquesas Standard Time
"Marquesas Standard Time"
MauritiusStandardTime = Mauritius Standard Time
"Mauritius Standard Time"
MidAtlanticStandardTime = Mid-Atlantic Standard Time
"Mid-Atlantic Standard Time"
MiddleEastStandardTime = Middle East Standard Time
"Middle East Standard Time"
MontevideoStandardTime = Montevideo Standard Time
"Montevideo Standard Time"
MoroccoStandardTime = Morocco Standard Time
"Morocco Standard Time"
MountainStandardTime = Mountain Standard Time
"Mountain Standard Time"
MountainStandardTime_Mexico Mountain Standard Time (Mexico)
= "Mountain Standard Time
(Mexico)"
MyanmarStandardTime = Myanmar Standard Time
"Myanmar Standard Time"
N_CentralAsiaStandardTime = North Central Asia Standard Time
"N. Central Asia Standard Time"
NamibiaStandardTime = Namibia Standard Time
"Namibia Standard Time"
NepalStandardTime = "Nepal Nepal Standard Time
Standard Time"
NewfoundlandStandardTime = Newfoundland Standard Time
"Newfoundland Standard Time"
NewZealandStandardTime = New Zealand Standard Time
"New Zealand Standard Time"
NorfolkStandardTime = Norfolk Standard Time
"Norfolk Standard Time"
NorthAsiaEastStandardTime = North Asia East Standard Time
"North Asia East Standard
Time"
NorthAsiaStandardTime = North Asia Standard Time
"North Asia Standard Time"
NorthKoreaStandardTime = North Korea Standard Time
"North Korea Standard Time"
OmskStandardTime = "Omsk Omsk Standard Time
Standard Time"
PacificSAStandardTime = Pacific SA Standard Time
"Pacific SA Standard Time"
PacificStandardTime = "Pacific Pacific Standard Time
Standard Time"
PacificStandardTimeMexico = Pacific Standard Time (Mexico)
"Pacific Standard Time
(Mexico)"
PakistanStandardTime = Pakistan Standard Time
"Pakistan Standard Time"
ParaguayStandardTime = Paraguay Standard Time
"Paraguay Standard Time"
RomanceStandardTime = Romance Standard Time
"Romance Standard Time"
RussianStandardTime = Russian Standard Time
"Russian Standard Time"
RussiaTimeZone10 = "Russia Russia Time Zone 10
Time Zone 10"
RussiaTimeZone11 = "Russia Russia Time Zone 11
Time Zone 11"
RussiaTimeZone3 = "Russia Russia Time Zone 3
Time Zone 3"
SAEasternStandardTime = "SA SA Eastern Standard Time
Eastern Standard Time"
SaintPierreStandardTime = Saint Pierre Standard Time
"Saint Pierre Standard Time"
SakhalinStandardTime = Sakhalin Standard Time
"Sakhalin Standard Time"
SamoaStandardTime = "Samoa Samoa Standard Time
Standard Time"
SAPacificStandardTime = "SA SA Pacific Standard Time
Pacific Standard Time"
SaratovStandardTime = Saratov Standard Time
"Saratov Standard Time"
SAWesternStandardTime = "SA SA Western Standard Time
Western Standard Time"
SEAsiaStandardTime = "SE Asia Southeast Asia Standard Time
Standard Time"
SingaporeStandardTime = Singapore Standard Time
"Singapore Standard Time"
SouthAfricaStandardTime = South Africa Standard Time
"South Africa Standard Time"
SriLankaStandardTime = "Sri Sri Lanka Standard Time
Lanka Standard Time"
SudanStandardTime = "Sudan Sudan Standard Time
Standard Time"
SyriaStandardTime = "Syria Syria Standard Time
Standard Time"
TaipeiStandardTime = "Taipei Taipei Standard Time
Standard Time"
TasmaniaStandardTime = Tasmania Standard Time
"Tasmania Standard Time"
TocantinsStandardTime = Tocantins Standard Time
"Tocantins Standard Time"
TokyoStandardTime = "Tokyo Tokyo Standard Time
Standard Time"
TomskStandardTime = "Tomsk Tomsk Standard Time
Standard Time"
TongaStandardTime = "Tonga Tonga Standard Time
Standard Time"
TransbaikalStandardTime = Transbaikal Standard Time
"Transbaikal Standard Time"
TurkeyStandardTime = "Turkey Turkey Standard Time
Standard Time"
TurksAndCaicosStandardTime Turks And Caicos Standard Time
= "Turks And Caicos Standard
Time"
UlaanbaatarStandardTime = Ulaanbaatar Standard Time
"Ulaanbaatar Standard Time"
USEasternStandardTime = "US United States Eastern Standard Time
Eastern Standard Time"
USMountainStandardTime = United States Mountain Standard Time
"US Mountain Standard Time"
UTC = "UTC" Coordinated Universal Time (UTC)
UTCMINUS02 = "UTC-02" Coordinated Universal Time (UTC) - 2 hours
UTCMINUS08 = "UTC-08" Coordinated Universal Time (UTC) - 8 hours
UTCMINUS09 = "UTC-09" Coordinated Universal Time (UTC) - 9 hours
UTCMINUS11 = "UTC-11" Coordinated Universal Time (UTC) - 11 hours
UTCPLUS12 = "UTC+12" Coordinated Universal Time (UTC) + 12 hours
UTCPLUS13 = "UTC+13" Coordinated Universal Time (UTC) + 13 hours
VenezuelaStandardTime = Venezuela Standard Time
"Venezuela Standard Time"
VladivostokStandardTime = Vladivostok Standard Time
"Vladivostok Standard Time"
W_AustraliaStandardTime = West Australia Standard Time
"W. Australia Standard Time"
W_CentralAfricaStandardTime West Central Africa Standard Time
= "W. Central Africa Standard
Time"
W_EuropeStandardTime = "W. West Europe Standard Time
Europe Standard Time"
W_MongoliaStandardTime = West Mongolia Standard Time
"W. Mongolia Standard Time"
WestAsiaStandardTime = "West West Asia Standard Time
Asia Standard Time"
WestBankStandardTime = West Bank Standard Time
"West Bank Standard Time"
WestPacificStandardTime = West Pacific Standard Time
"West Pacific Standard Time"
YakutskStandardTime = Yakutsk Standard Time
"Yakutsk Standard Time"
Office.MailboxEnums.RecurrenceType
enum
Reference
Package: outlook
Specifies the type of recurrence.
Remarks
[ API set: Mailbox 1.7 ]
Applicable Outlook mode: Compose or Read
Examples
TypeScript
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-
js-snippets/prod/samples/outlook/50-recurrence/get-set-recurrence-
appointment-organizer.yaml
// Important: Can only set the recurrence pattern of an appointment series.
const currentDate = new Date();
let seriesTimeObject: Office.SeriesTime;
// Set series start date to tomorrow.
seriesTimeObject.setStartDate(currentDate.getFullYear(),
currentDate.getMonth(), currentDate.getDay() + 1);
// Set series end date to one year from now.
seriesTimeObject.setEndDate(currentDate.getFullYear() + 1,
currentDate.getMonth() + 1, currentDate.getDay());
// Set start time to 1:30 PM.
seriesTimeObject.setStartTime(13, 30);
// Set duration to 30 minutes.
seriesTimeObject.setDuration(30);
const pattern: Office.Recurrence = {
seriesTime: seriesTimeObject,
recurrenceType: Office.MailboxEnums.RecurrenceType.Yearly,
recurrenceProperties: {
interval: 1,
dayOfWeek: Office.MailboxEnums.Days.Tue,
weekNumber: Office.MailboxEnums.WeekNumber.Second,
month: Office.MailboxEnums.Month.Sep
},
recurrenceTimeZone: { name:
Office.MailboxEnums.RecurrenceTimeZone.PacificStandardTime }
};
Office.context.mailbox.item.recurrence.setAsync(pattern, (asyncResult) => {
if (asyncResult.status !== Office.AsyncResultStatus.Succeeded) {
console.error(`Failed to set recurrence. Error:
${asyncResult.error.message}`);
return;
}
console.log(`Succeeded in setting recurrence pattern
${JSON.stringify(pattern)}`);
});
Fields
Daily = "daily" Daily.
Monthly = "monthly" Monthly.
Weekday = "weekday" Weekday.
Weekly = "weekly" Weekly.
Yearly = "yearly" Yearly.
Office.MailboxEnums.ResponseType
enum
Reference
Package: outlook
Specifies the type of response to a meeting invitation.
Remarks
Applicable Outlook mode: Compose or Read
Examples
TypeScript
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-
js-snippets/prod/samples/outlook/30-recipients-and-attendees/get-all-
attendees.yaml
function organizeByResponse(attendees) {
const accepted = [];
const declined = [];
const noResponse = [];
const tentative = [];
attendees.forEach(attendee => {
switch (attendee.appointmentResponse) {
case Office.MailboxEnums.ResponseType.Accepted:
accepted.push(attendee);
break;
case Office.MailboxEnums.ResponseType.Declined:
declined.push(attendee);
break;
case Office.MailboxEnums.ResponseType.None:
noResponse.push(attendee);
break;
case Office.MailboxEnums.ResponseType.Tentative:
tentative.push(attendee);
break;
case Office.MailboxEnums.ResponseType.Organizer:
console.log(`Organizer: ${attendee.displayName},
${attendee.emailAddress}`);
break;
}
});
// List attendees by their response.
console.log("Accepted: ");
printAttendees(accepted);
console.log("Declined: ");
printAttendees(declined);
console.log("Tentative: ");
printAttendees(tentative);
console.log("No response: ");
printAttendees(noResponse);
}
Fields
Accepted = "accepted" The meeting request was accepted by the attendee.
Declined = "declined" The meeting request was declined by the attendee.
None = "none" There has been no response from the attendee.
Organizer = "organizer" The attendee is the meeting organizer.
Tentative = "tentative" The meeting request was tentatively accepted by the attendee.
Office.MailboxEnums.RestVersion enum
Reference
Package: outlook
Specifies the version of the REST API that corresponds to a REST-formatted item ID.
Remarks
[ API set: Mailbox 1.3 ]
Applicable Outlook mode: Compose or Read
Examples
TypeScript
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-
js-snippets/prod/samples/outlook/85-tokens-and-service-calls/basic-rest-
cors.yaml
Office.context.mailbox.getCallbackTokenAsync({ isRest: true }, function
(result) {
const ewsId = Office.context.mailbox.item.itemId;
const token = result.value;
const restId = Office.context.mailbox.convertToRestId(ewsId,
Office.MailboxEnums.RestVersion.v2_0);
const getMessageUrl = Office.context.mailbox.restUrl +
'/v2.0/me/messages/' + restId;
const xhr = new XMLHttpRequest();
xhr.open('GET', getMessageUrl);
xhr.setRequestHeader("Authorization", "Bearer " + token);
xhr.onload = function (e) {
console.log(this.response);
}
xhr.send();
});
Fields
Beta = "beta" Beta.
v1_0 = "v1.0" Version 1.0.
v2_0 = "v2.0" Version 2.0.
Office.MailboxEnums.SourceProperty
enum
Reference
Package: outlook
Specifies the source of the selected data in an item (see
Office.mailbox.item.getSelectedDataAsync for details).
Remarks
[ API set: Mailbox 1.2 ]
Applicable Outlook mode: Compose
Examples
TypeScript
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-
js-snippets/prod/samples/outlook/20-item-body/get-selected-data.yaml
Office.context.mailbox.item.getSelectedDataAsync(Office.CoercionType.Text,
function(asyncResult) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
const text = asyncResult.value.data;
const prop = asyncResult.value.sourceProperty;
console.log("Selected text in " + prop + ": " + text);
} else {
console.error(asyncResult.error);
}
});
Fields
Body = "body" The source of the data is from the body of the item.
Subject = "subject" The source of the data is from the subject of the item.
Office.MailboxEnums.WeekNumber
enum
Reference
Package: outlook
Specifies the week of the month.
Remarks
[ API set: Mailbox 1.7 ]
Applicable Outlook mode: Compose or Read
Examples
TypeScript
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-
js-snippets/prod/samples/outlook/50-recurrence/get-set-recurrence-
appointment-organizer.yaml
// Important: Can only set the recurrence pattern of an appointment series.
const currentDate = new Date();
let seriesTimeObject: Office.SeriesTime;
// Set series start date to tomorrow.
seriesTimeObject.setStartDate(currentDate.getFullYear(),
currentDate.getMonth(), currentDate.getDay() + 1);
// Set series end date to one year from now.
seriesTimeObject.setEndDate(currentDate.getFullYear() + 1,
currentDate.getMonth() + 1, currentDate.getDay());
// Set start time to 1:30 PM.
seriesTimeObject.setStartTime(13, 30);
// Set duration to 30 minutes.
seriesTimeObject.setDuration(30);
const pattern: Office.Recurrence = {
seriesTime: seriesTimeObject,
recurrenceType: Office.MailboxEnums.RecurrenceType.Yearly,
recurrenceProperties: {
interval: 1,
dayOfWeek: Office.MailboxEnums.Days.Tue,
weekNumber: Office.MailboxEnums.WeekNumber.Second,
month: Office.MailboxEnums.Month.Sep
},
recurrenceTimeZone: { name:
Office.MailboxEnums.RecurrenceTimeZone.PacificStandardTime }
};
Office.context.mailbox.item.recurrence.setAsync(pattern, (asyncResult) => {
if (asyncResult.status !== Office.AsyncResultStatus.Succeeded) {
console.error(`Failed to set recurrence. Error:
${asyncResult.error.message}`);
return;
}
console.log(`Succeeded in setting recurrence pattern
${JSON.stringify(pattern)}`);
});
Fields
First = "first" First week of the month.
Fourth = "fourth" Fourth week of the month.
Last = "last" Last week of the month.
Second = "second" Second week of the month.
Third = "third" Third week of the month.
Office.AppointmentCompose interface
Reference
Package: outlook
The appointment organizer mode of Office.context.mailbox.item.
Important: This is an internal Outlook object, not directly exposed through existing
interfaces. You should treat this as a mode of Office.context.mailbox.item . For more
information, refer to the Object Model page.
Parent interfaces:
ItemCompose
Appointment
Extends Office.Appointment
Properties
body Gets an object that provides methods for manipulating the body
of an item.
categories Gets an object that provides methods for managing the item's
categories.
end Gets or sets the date and time that the appointment is to end.
The end property is a Time object expressed as a Coordinated
Universal Time (UTC) date and time value. You can use the
convertToLocalClientTime method to convert the end property
value to the client's local date and time.
When you use the Time.setAsync method to set the end time,
you should use the convertToUtcClientTime method to convert
the local time on the client to UTC for the server.
Important: In the Windows client, you can't use this property to
update the end of a recurrence.
enhancedLocation Gets or sets the locations of the appointment. The
enhancedLocation property returns an EnhancedLocation object
that provides methods to get, remove, or add locations on an
item.
itemType Gets the type of item that an instance represents.
The itemType property returns one of the ItemType enumeration
values, indicating whether the item object instance is a message
or an appointment.
location Gets or sets the location of an appointment. The location
property returns a Location object that provides methods that
are used to get and set the location of the appointment.
notificationMessages Gets the notification messages for an item.
optionalAttendees Provides access to the optional attendees of an event. The type
of object and level of access depend on the mode of the current
item.
The optionalAttendees property returns a Recipients object
that provides methods to get or update the optional attendees
for a meeting. However, depending on the client/platform (i.e.,
Windows, Mac, etc.), limits may apply on how many recipients
you can get or update. See the Recipients object for more
details.
organizer Gets the organizer for the specified meeting.
The organizer property returns an Organizer object that
provides a method to get the organizer value.
recurrence Gets or sets the recurrence pattern of an appointment.
The recurrence property returns a recurrence object for
recurring appointments or meetings requests if an item is a
series or an instance in a series. null is returned for single
appointments and meeting requests of single appointments.
Note: Meeting requests have an itemClass value of
IPM.Schedule.Meeting.Request .
Note: If the recurrence object is null, this indicates that the
object is a single appointment or a meeting request of a single
appointment and NOT a part of a series.
requiredAttendees Provides access to the required attendees of an event. The type
of object and level of access depend on the mode of the current
item.
The requiredAttendees property returns a Recipients object
that provides methods to get or update the required attendees
for a meeting. However, depending on the client/platform (i.e.,
Windows, Mac, etc.), limits may apply on how many recipients
you can get or update. See the Recipients object for more
details.
seriesId Gets the ID of the series that an instance belongs to.
In Outlook on the web and desktop clients, the seriesId
property returns the Exchange Web Services (EWS) ID of the
parent (series) item that this item belongs to. However, on iOS
and Android, the seriesId returns the REST ID of the parent item.
Note: The identifier returned by the seriesId property is the
same as the Exchange Web Services item identifier. The seriesId
property is not identical to the Outlook IDs used by the Outlook
REST API. Before making REST API calls using this value, it should
be converted using Office.context.mailbox.convertToRestId .
For more details, see Use the Outlook REST APIs from an
Outlook add-in.
The seriesId property returns null for items that do not have
parent items such as single appointments, series items, or
meeting requests and returns undefined for any other items that
are not meeting requests.
sessionData Manages the SessionData of an item in Compose mode.
Important: The entire SessionData object is limited to 50,000
characters per add-in.
start Gets or sets the date and time that the appointment is to begin.
The start property is a Time object expressed as a Coordinated
Universal Time (UTC) date and time value. You can use the
convertToLocalClientTime method to convert the value to the
client's local date and time.
When you use the Time.setAsync method to set the start time,
you should use the convertToUtcClientTime method to convert
the local time on the client to UTC for the server.
Important: In the Windows client, you can't use this property to
update the start of a recurrence.
subject Gets or sets the description that appears in the subject field of
an item.
The subject property gets or sets the entire subject of the item,
as sent by the email server.
The subject property returns a Subject object that provides
methods to get and set the subject.
Methods
addFileAttachmentAsync(uri, Adds a file to a message or appointment as an attachment.
attachmentName, options,
callback) The addFileAttachmentAsync method uploads the file at the
specified URI and attaches it to the item in the compose form.
You can subsequently use the identifier with the
removeAttachmentAsync method to remove the attachment in the
same session.
Important: In recent builds of Outlook on Windows, a bug was
introduced that incorrectly appends an Authorization: Bearer
header to this action (whether using this API or the Outlook UI).
To work around this issue, you can try using the
addFileAttachmentFromBase64 API introduced with requirement
set 1.8.
addFileAttachmentAsync(uri, Adds a file to a message or appointment as an attachment.
attachmentName, callback)
The addFileAttachmentAsync method uploads the file at the
specified URI and attaches it to the item in the compose form.
You can subsequently use the identifier with the
removeAttachmentAsync method to remove the attachment in the
same session.
Important: In recent builds of Outlook on Windows, a bug was
introduced that incorrectly appends an Authorization: Bearer
header to this action (whether using this API or the Outlook UI).
To work around this issue, you can try using the
addFileAttachmentFromBase64 API introduced with requirement
set 1.8.
addFileAttachmentFrom Adds a file to a message or appointment as an attachment.
Base64Async(base64File,
attachmentName, options, The addFileAttachmentFromBase64Async method uploads the file
callback) from the Base64 encoding and attaches it to the item in the
compose form. This method returns the attachment identifier in
the asyncResult.value object.
You can subsequently use the identifier with the
removeAttachmentAsync method to remove the attachment in the
same session.
Note: If you're using a data URL API (e.g., readAsDataURL ), you
need to strip out the data URL prefix then send the rest of the
string to this API. For example, if the full string is represented by
data:image/svg+xml;base64,<rest of Base64 string> , remove
data:image/svg+xml;base64, .
addFileAttachmentFrom Adds a file to a message or appointment as an attachment.
Base64Async(base64File,
attachmentName, callback) The addFileAttachmentFromBase64Async method uploads the file
from the Base64 encoding and attaches it to the item in the
compose form. This method returns the attachment identifier in
the asyncResult.value object.
You can subsequently use the identifier with the
removeAttachmentAsync method to remove the attachment in the
same session.
Note: If you're using a data URL API (e.g., readAsDataURL ), you
need to strip out the data URL prefix then send the rest of the
string to this API. For example, if the full string is represented by
data:image/svg+xml;base64,<rest of Base64 string> , remove
data:image/svg+xml;base64, .
addHandlerAsync(eventType, Adds an event handler for a supported event. Note: Events are
handler, options, callback) only available with task pane implementation.
For supported events, refer to the Item object model events
section.
addHandlerAsync(eventType, Adds an event handler for a supported event. Note: Events are
handler, callback) only available with task pane implementation.
For supported events, refer to the Item object model events
section.
addItemAttachment Adds an Exchange item, such as a message, as an attachment to
Async(itemId, attachment the message or appointment.
Name, options, callback)
The addItemAttachmentAsync method attaches the item with the
specified Exchange identifier to the item in the compose form. If
you specify a callback function, the method is called with one
parameter, asyncResult , which contains either the attachment
identifier or a code that indicates any error that occurred while
attaching the item. You can use the options parameter to pass
state information to the callback function, if needed.
You can subsequently use the identifier with the
removeAttachmentAsync method to remove the attachment in the
same session.
If your Office Add-in is running in Outlook on the web, the
addItemAttachmentAsync method can attach items to items other
than the item that you are editing; however, this is not supported
and is not recommended.
addItemAttachment Adds an Exchange item, such as a message, as an attachment to
Async(itemId, attachment the message or appointment.
Name, callback)
The addItemAttachmentAsync method attaches the item with the
specified Exchange identifier to the item in the compose form. If
you specify a callback function, the method is called with one
parameter, asyncResult , which contains either the attachment
identifier or a code that indicates any error that occurred while
attaching the item. You can use the options parameter to pass
state information to the callback function, if needed.
You can subsequently use the identifier with the
removeAttachmentAsync method to remove the attachment in the
same session.
If your Office Add-in is running in Outlook on the web, the
addItemAttachmentAsync method can attach items to items other
than the item that you are editing; however, this is not supported
and is not recommended.
close() Closes the current item that is being composed.
The behavior of the close method depends on the current state
of the item being composed. If the item has unsaved changes,
the client prompts the user to save, discard, or close the action.
In the Outlook desktop client, the close method has no effect
on a reply in the Reading Pane.
disableClientSignature Disables the Outlook client signature.
Async(options, callback)
For Windows and Mac rich clients, this API sets the signature
under the "New Message" and "Replies/Forwards" sections for
the sending account to "(none)", effectively disabling the
signature. For Outlook on the web, the API should disable the
signature option for new mails, replies, and forwards. If the
signature is selected, this API call should disable it.
disableClientSignature Disables the Outlook client signature.
Async(callback)
For Windows and Mac rich clients, this API sets the signature
under the "New Message" and "Replies/Forwards" sections for
the sending account to "(none)", effectively disabling the
signature. For Outlook on the web, the API should disable the
signature option for new mails, replies, and forwards. If the
signature is selected, this API call should disable it.
getAttachmentContent Gets an attachment from a message or appointment and returns
Async(attachmentId, options, it as an AttachmentContent object.
callback)
The getAttachmentContentAsync method gets the attachment
with the specified identifier from the item. As a best practice, you
should get the attachment's identifier from a
getAttachmentsAsync call, then in the same session, use that
identifier to retrieve the attachment. In Outlook on the web and
mobile devices, the attachment identifier is valid only within the
same session. A session is over when the user closes the app, or
if the user starts composing an inline form then subsequently
pops out the form to continue in a separate window.
getAttachmentContent Gets an attachment from a message or appointment and returns
Async(attachmentId, callback) it as an AttachmentContent object.
The getAttachmentContentAsync method gets the attachment
with the specified identifier from the item. As a best practice, you
should get the attachment's identifier from a
getAttachmentsAsync call, then in the same session, use that
identifier to retrieve the attachment. In Outlook on the web and
mobile devices, the attachment identifier is valid only within the
same session. A session is over when the user closes the app, or
if the user starts composing an inline form then subsequently
pops out the form to continue in a separate window.
getAttachments Gets the item's attachments as an array.
Async(options, callback)
getAttachments Gets the item's attachments as an array.
Async(callback)
getInitializationContext Gets initialization data passed when the add-in is activated by an
Async(options, callback) actionable message.
getInitializationContext Gets initialization data passed when the add-in is activated by an
Async(callback) actionable message.
getItemIdAsync(options, Asynchronously gets the ID of a saved item.
callback)
When invoked, this method returns the item ID via the callback
function.
Note: If your add-in calls getItemIdAsync on an item in compose
mode (e.g., to get an itemId to use with EWS or the REST API),
be aware that when Outlook is in cached mode, it may take
some time before the item is synced to the server. Until the item
is synced, the itemId is not recognized and using it returns an
error.
getItemIdAsync(callback) Asynchronously gets the ID of a saved item.
When invoked, this method returns the item ID via the callback
function.
Note: If your add-in calls getItemIdAsync on an item in compose
mode (e.g., to get an itemId to use with EWS or the REST API),
be aware that when Outlook is in cached mode, it may take
some time before the item is synced to the server. Until the item
is synced, the itemId is not recognized and using it returns an
error.
getSelectedData Asynchronously returns selected data from the subject or body
Async(coercionType, options, of a message.
callback)
If there is no selection but the cursor is in the body or subject,
the method returns an empty string for the selected data. If a
field other than the body or subject is selected, the method
returns the InvalidSelection error.
To access the selected data from the callback function, call
asyncResult.value.data . To access the source property that the
selection comes from, call asyncResult.value.sourceProperty ,
which will be either body or subject .
getSelectedData Asynchronously returns selected data from the subject or body
Async(coercionType, callback) of a message.
If there is no selection but the cursor is in the body or subject,
the method returns an empty string for the selected data. If a
field other than the body or subject is selected, the method
returns the InvalidSelection error.
To access the selected data from the callback function, call
asyncResult.value.data . To access the source property that the
selection comes from, call asyncResult.value.sourceProperty ,
which will be either body or subject .
getSharedProperties Gets the properties of an appointment or message in a shared
Async(options, callback) folder or shared mailbox.
For more information around using this API, see Enable shared
folders and shared mailbox scenarios in an Outlook add-in.
getSharedProperties Gets the properties of an appointment or message in a shared
Async(callback) folder or shared mailbox.
For more information around using this API, see Enable shared
folders and shared mailbox scenarios in an Outlook add-in.
isClientSignatureEnabled Gets if the client signature is enabled.
Async(options, callback)
For Windows and Mac rich clients, the API call should return
true if the default signature for new messages, replies, or
forwards is set to a template for the sending Outlook account.
For Outlook on the web, the API call should return true if the
signature is enabled for compose types newMail , reply , or
forward . If the settings are set to "(none)" in Mac or Windows
rich clients or disabled in Outlook on the Web, the API call
should return false .
isClientSignatureEnabled Gets if the client signature is enabled.
Async(callback)
For Windows and Mac rich clients, the API call should return
true if the default signature for new messages, replies, or
forwards is set to a template for the sending Outlook account.
For Outlook on the web, the API call should return true if the
signature is enabled for compose types newMail , reply , or
forward . If the settings are set to "(none)" in Mac or Windows
rich clients or disabled in Outlook on the Web, the API call
should return false .
loadCustomProperties Asynchronously loads custom properties for this add-in on the
Async(callback, userContext) selected item.
Custom properties are stored as key-value pairs on a per-app,
per-item basis. This method returns a CustomProperties object in
the callback, which provides methods to access the custom
properties specific to the current item and the current add-in.
Custom properties aren't encrypted on the item, so this
shouldn't be used as secure storage.
The custom properties are provided as a CustomProperties
object in the asyncResult.value property. This object can be
used to get, set, save, and remove custom properties from the
mail item.
removeAttachment Removes an attachment from a message or appointment.
Async(attachmentId, options,
callback) The removeAttachmentAsync method removes the attachment
with the specified identifier from the item. As a best practice, you
should use the attachment identifier to remove an attachment
only if the same mail app has added that attachment in the same
session. In Outlook on the web and mobile devices, the
attachment identifier is valid only within the same session. A
session is over when the user closes the app, or if the user starts
composing an inline form then subsequently pops out the form
to continue in a separate window.
removeAttachment Removes an attachment from a message or appointment.
Async(attachmentId, callback)
The removeAttachmentAsync method removes the attachment
with the specified identifier from the item. As a best practice, you
should use the attachment identifier to remove an attachment
only if the same mail app has added that attachment in the same
session. In Outlook on the web and mobile devices, the
attachment identifier is valid only within the same session. A
session is over when the user closes the app, or if the user starts
composing an inline form then subsequently pops out the form
to continue in a separate window.
removeHandlerAsync(event Removes the event handlers for a supported event type. Note:
Type, options, callback) Events are only available with task pane implementation.
For supported events, refer to the Item object model events
section.
removeHandlerAsync(event Removes the event handlers for a supported event type. Note:
Type, callback) Events are only available with task pane implementation.
For supported events, refer to the Item object model events
section.
saveAsync(options, callback) Asynchronously saves an item.
When invoked, this method saves the current message as a draft
and returns the item ID via the callback function. In Outlook on
the web or Outlook in online mode, the item is saved to the
server. In Outlook in cached mode, the item is saved to the local
cache.
Since appointments have no draft state, if saveAsync is called on
an appointment in compose mode, the item will be saved as a
normal appointment on the user's calendar. For new
appointments that have not been saved before, no invitation will
be sent. Saving an existing appointment will send an update to
added or removed attendees.
When working with HTML-formatted content, it's important to
note that the Outlook client may modify the content. This means
that subsequent calls to methods like Body.getAsync ,
Body.setAsync , and even saveAsync may not result in the same
content.
Note: If your add-in calls saveAsync on an item in compose
mode in order to get an item ID to use with EWS or the REST
API, be aware that when Outlook is in cached mode, it may take
some time before the item is actually synced to the server. Until
the item is synced, using the item ID will return an error.
Note: In Outlook on Mac, only build 16.35.308 or later supports
saving a meeting. Otherwise, the saveAsync method fails when
called from a meeting in compose mode. For a workaround, see
Cannot save a meeting as a draft in Outlook for Mac by using
Office JS API.
saveAsync(callback) Asynchronously saves an item.
When invoked, this method saves the current message as a draft
and returns the item ID via the callback function. In Outlook on
the web or Outlook in online mode, the item is saved to the
server. In Outlook in cached mode, the item is saved to the local
cache.
Since appointments have no draft state, if saveAsync is called on
an appointment in compose mode, the item will be saved as a
normal appointment on the user's calendar. For new
appointments that have not been saved before, no invitation will
be sent. Saving an existing appointment will send an update to
added or removed attendees.
When working with HTML-formatted content, it's important to
note that the Outlook client may modify the content. This means
that subsequent calls to methods like Body.getAsync ,
Body.setAsync , and even saveAsync may not result in the same
content.
Note: If your add-in calls saveAsync on an item in compose
mode in order to get an item ID to use with EWS or the REST
API, be aware that when Outlook is in cached mode, it may take
some time before the item is actually synced to the server. Until
the item is synced, using the item ID will return an error.
Note: In Outlook on Mac, only build 16.35.308 or later supports
saving a meeting. Otherwise, the saveAsync method fails when
called from a meeting in compose mode. For a workaround, see
Cannot save a meeting as a draft in Outlook for Mac by using
Office JS API.
setSelectedDataAsync(data, Asynchronously inserts data into the body or subject of a
options, callback) message.
The setSelectedDataAsync method inserts the specified string at
the cursor location in the subject or body of the item, or, if text is
selected in the editor, it replaces the selected text. If the cursor is
not in the body or subject field, an error is returned. After
insertion, the cursor is placed at the end of the inserted content.
setSelectedDataAsync(data, Asynchronously inserts data into the body or subject of a
callback) message.
The setSelectedDataAsync method inserts the specified string at
the cursor location in the subject or body of the item, or, if text is
selected in the editor, it replaces the selected text. If the cursor is
not in the body or subject field, an error is returned. After
insertion, the cursor is placed at the end of the inserted content.
Property Details
body
Gets an object that provides methods for manipulating the body of an item.
TypeScript
body: Body;
Property Value
Office.Body
Remarks
[ API set: Mailbox 1.1 ]
Minimum permission level: read item
Applicable Outlook mode: Appointment Organizer
Examples
TypeScript
// This example gets the body of the item as plain text.
Office.context.mailbox.item.body.getAsync(
"text",
{ asyncContext: "This is passed to the callback" },
function callback(result) {
// Do something with the result.
});
// The following is an example of an object that is passed as the result
parameter to the callback function.
{
"value": "TEXT of whole body (including threads below)",
"status": "succeeded",
"asyncContext": "This is passed to the callback"
}
categories
Gets an object that provides methods for managing the item's categories.
TypeScript
categories: Categories;
Property Value
Office.Categories
Remarks
[ API set: Mailbox 1.8 ]
Minimum permission level: read item
Applicable Outlook mode: Appointment Organizer
Examples
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/45-categories/work-with-categories.yaml
Office.context.mailbox.item.categories.getAsync(function(asyncResult) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
const categories = asyncResult.value;
if (categories && categories.length > 0) {
console.log("Categories assigned to this item:");
console.log(JSON.stringify(categories));
} else {
console.log("There are no categories assigned to this item.");
}
} else {
console.error(asyncResult.error);
}
});
...
// Note: In order for you to successfully add a category,
// it must be in the mailbox categories master list.
Office.context.mailbox.masterCategories.getAsync(function(asyncResult) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
const masterCategories = asyncResult.value;
if (masterCategories && masterCategories.length > 0) {
// Grab the first category from the master list.
const categoryToAdd = [masterCategories[0].displayName];
Office.context.mailbox.item.categories.addAsync(categoryToAdd,
function(asyncResult) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
console.log(`Successfully assigned category '${categoryToAdd}'
to item.`);
} else {
console.log("categories.addAsync call failed with error: " +
asyncResult.error.message);
}
});
} else {
console.log("There are no categories in the master list on this
mailbox. You can add categories using
Office.context.mailbox.masterCategories.addAsync.");
}
} else {
console.error(asyncResult.error);
}
});
...
Office.context.mailbox.item.categories.getAsync(function(asyncResult) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
const categories = asyncResult.value;
if (categories && categories.length > 0) {
// Grab the first category assigned to this item.
const categoryToRemove = [categories[0].displayName];
Office.context.mailbox.item.categories.removeAsync(categoryToRemove,
function(asyncResult) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
console.log(`Successfully unassigned category
'${categoryToRemove}' from this item.`);
} else {
console.log("categories.removeAsync call failed with error: " +
asyncResult.error.message);
}
});
} else {
console.log("There are no categories assigned to this item.");
}
} else {
console.error(asyncResult.error);
}
});
end
Gets or sets the date and time that the appointment is to end.
The end property is a Time object expressed as a Coordinated Universal Time (UTC)
date and time value. You can use the convertToLocalClientTime method to convert
the end property value to the client's local date and time.
When you use the Time.setAsync method to set the end time, you should use the
convertToUtcClientTime method to convert the local time on the client to UTC for
the server.
Important: In the Windows client, you can't use this property to update the end of a
recurrence.
TypeScript
end: Time;
Property Value
Office.Time
Remarks
Minimum permission level: read item
Applicable Outlook mode: Appointment Organizer
Examples
TypeScript
// The following example sets the end time of an appointment in compose
mode by
// using the `setAsync` method of the `Time` object.
const endTime = new Date("3/14/2015");
const options = {
// Pass information that can be used in the callback.
asyncContext: {verb: "Set"}
};
Office.context.mailbox.item.end.setAsync(endTime, options,
function(result) {
if (result.error) {
console.debug(result.error);
} else {
// Access the asyncContext that was passed to the setAsync
method.
console.debug("End Time " + result.asyncContext.verb);
}
});
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/90-other-item-apis/get-set-end-appointment-
organizer.yaml
Office.context.mailbox.item.end.getAsync((result) => {
if (result.status !== Office.AsyncResultStatus.Succeeded) {
console.error(`Action failed with message ${result.error.message}`);
return;
}
console.log(`Appointment ends: ${result.value}`);
});
...
Office.context.mailbox.item.start.getAsync((result) => {
if (result.status !== Office.AsyncResultStatus.Succeeded) {
console.error(`Get start date failed with message
${result.error.message}`);
return;
}
const end = result.value; // Set end to current start date and time.
end.setDate(end.getDate() + 1); // Set end as 1 day later than start
date.
Office.context.mailbox.item.end.setAsync(end, (result) => {
if (result.status !== Office.AsyncResultStatus.Succeeded) {
console.error(`Set end date failed with message
${result.error.message}`);
return;
}
console.log(`Successfully set end date and time to ${end}`);
});
});
enhancedLocation
Gets or sets the locations of the appointment. The enhancedLocation property
returns an EnhancedLocation object that provides methods to get, remove, or add
locations on an item.
TypeScript
enhancedLocation: EnhancedLocation;
Property Value
Office.EnhancedLocation
Remarks
[ API set: Mailbox 1.8 ]
Minimum permission level: read item
Applicable Outlook mode: Appointment Organizer
Examples
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/90-other-item-apis/get-add-remove-
enhancedlocation-appointment.yaml
Office.context.mailbox.item.enhancedLocation.getAsync((result) => {
if (result.status !== Office.AsyncResultStatus.Succeeded) {
console.error(`Failed to get locations. Error message:
${result.error.message}`);
return;
}
const places = result.value;
if (places && places.length > 0) {
result.value.forEach(function(place) {
console.log(`Location: ${place.displayName} (type:
${place.locationIdentifier.type})`);
if (place.locationIdentifier.type ===
Office.MailboxEnums.LocationType.Room) {
console.log("Email address: " + place.emailAddress);
}
});
} else {
console.log("There are no locations.");
}
});
...
const locations = [
{
id: "Contoso",
type: Office.MailboxEnums.LocationType.Custom
},
{
id: "[email protected]",
type: Office.MailboxEnums.LocationType.Room
}
];
Office.context.mailbox.item.enhancedLocation.addAsync(locations, (result)
=> {
if (result.status === Office.AsyncResultStatus.Succeeded) {
console.log(`Successfully added locations
${JSON.stringify(locations)}`);
} else {
console.error(`Failed to add locations. Error message:
${result.error.message}`);
}
});
...
const locations = [
{
id: "Contoso",
type: Office.MailboxEnums.LocationType.Custom
},
{
id: "[email protected]",
type: Office.MailboxEnums.LocationType.Room
}
];
Office.context.mailbox.item.enhancedLocation.removeAsync(locations,
(result) => {
if (result.status === Office.AsyncResultStatus.Succeeded) {
console.log(`Successfully removed locations
${JSON.stringify(locations)}`);
} else {
console.error(`Failed to remove locations. Error message:
${result.error.message}`);
}
});
itemType
Gets the type of item that an instance represents.
The itemType property returns one of the ItemType enumeration values, indicating
whether the item object instance is a message or an appointment.
TypeScript
itemType: MailboxEnums.ItemType | string;
Property Value
Office.MailboxEnums.ItemType | string
Remarks
Minimum permission level: read item
Applicable Outlook mode: Appointment Organizer
Examples
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/90-other-item-apis/get-item-type.yaml
const itemType = Office.context.mailbox.item.itemType;
switch (itemType) {
case Office.MailboxEnums.ItemType.Appointment:
console.log(`Current item is an ${itemType}.`);
break;
case Office.MailboxEnums.ItemType.Message:
console.log(`Current item is a ${itemType}. A message could be an
email, meeting request, meeting response, or meeting cancellation.`);
break;
}
location
Gets or sets the location of an appointment. The location property returns a
Location object that provides methods that are used to get and set the location of
the appointment.
TypeScript
location: Location;
Property Value
Office.Location
Remarks
Minimum permission level: read item
Applicable Outlook mode: Appointment Organizer
Examples
TypeScript
const userContext = { value : 1 };
Office.context.mailbox.item.location.getAsync( { context: userContext},
callback);
function callback(asyncResult) {
const context = asyncResult.context;
const location = asyncResult.value;
}
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/90-other-item-apis/get-set-location-
appointment-organizer.yaml
Office.context.mailbox.item.location.getAsync((result) => {
if (result.status !== Office.AsyncResultStatus.Succeeded) {
console.error(`Action failed with message ${result.error.message}`);
return;
}
console.log(`Appointment location: ${result.value}`);
});
...
const location = "my office";
Office.context.mailbox.item.location.setAsync(location, (result) => {
if (result.status !== Office.AsyncResultStatus.Succeeded) {
console.error(`Action failed with message ${result.error.message}`);
return;
}
console.log(`Successfully set location to ${location}`);
});
notificationMessages
Gets the notification messages for an item.
TypeScript
notificationMessages: NotificationMessages;
Property Value
Office.NotificationMessages
Remarks
[ API set: Mailbox 1.3 ]
Minimum permission level: read item
Applicable Outlook mode: Appointment Organizer
Examples
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/35-notifications/add-getall-remove.yaml
const id = $("#notificationId").val();
const details =
{
type:
Office.MailboxEnums.ItemNotificationMessageType.ProgressIndicator,
message: "Progress indicator with id = " + id
};
Office.context.mailbox.item.notificationMessages.addAsync(id, details,
handleResult);
...
const id = $("#notificationId").val();
const details =
{
type:
Office.MailboxEnums.ItemNotificationMessageType.InformationalMessage,
message: "Non-persistent informational notification message with id =
" + id,
icon: "icon1",
persistent: false
};
Office.context.mailbox.item.notificationMessages.addAsync(id, details,
handleResult);
...
const id = $("#notificationId").val();
const details =
{
type:
Office.MailboxEnums.ItemNotificationMessageType.InformationalMessage,
message: "Persistent informational notification message with id = " +
id,
icon: "icon1",
persistent: true
};
Office.context.mailbox.item.notificationMessages.addAsync(id, details,
handleResult);
...
Office.context.mailbox.item.notificationMessages.getAllAsync(handleResult
);
...
const id = $("#notificationId").val();
Office.context.mailbox.item.notificationMessages.replaceAsync(
id,
{
type:
Office.MailboxEnums.ItemNotificationMessageType.InformationalMessage,
message: "Notification message with id = " + id + " has been replaced
with an informational message.",
icon: "icon2",
persistent: false
},
handleResult);
...
const id = $("#notificationId").val();
Office.context.mailbox.item.notificationMessages.removeAsync(id,
handleResult);
optionalAttendees
Provides access to the optional attendees of an event. The type of object and level of
access depend on the mode of the current item.
The optionalAttendees property returns a Recipients object that provides methods
to get or update the optional attendees for a meeting. However, depending on the
client/platform (i.e., Windows, Mac, etc.), limits may apply on how many recipients
you can get or update. See the Recipients object for more details.
TypeScript
optionalAttendees: Recipients;
Property Value
Office.Recipients
Remarks
Minimum permission level: read item
Applicable Outlook mode: Appointment Organizer
Examples
TypeScript
Office.context.mailbox.item.optionalAttendees.setAsync(
['[email protected]', '[email protected]'] );
Office.context.mailbox.item.optionalAttendees.addAsync(
['[email protected]'] );
Office.context.mailbox.item.optionalAttendees.getAsync(callback);
function callback(asyncResult) {
const arrayOfOptionalAttendeesRecipients = asyncResult.value;
}
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/30-recipients-and-attendees/get-set-
optional-attendees-appointment-organizer.yaml
Office.context.mailbox.item.optionalAttendees.getAsync(function(asyncResu
lt) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
const apptOptionalAttendees = asyncResult.value;
for (let i = 0; i < apptOptionalAttendees.length; i++) {
console.log(
"Optional attendees: " +
apptOptionalAttendees[i].displayName +
" (" +
apptOptionalAttendees[i].emailAddress +
") - response: " +
apptOptionalAttendees[i].appointmentResponse
);
}
} else {
console.error(asyncResult.error);
}
});
...
const email = $("#emailOptional")
.val()
.toString();
const emailArray = [email];
Office.context.mailbox.item.optionalAttendees.setAsync(emailArray,
function(asyncResult) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
console.log("Succeeded in setting optional attendees field.");
} else {
console.error(asyncResult.error);
}
});
organizer
Gets the organizer for the specified meeting.
The organizer property returns an Organizer object that provides a method to get
the organizer value.
TypeScript
organizer: Organizer;
Property Value
Office.Organizer
Remarks
[ API set: Mailbox 1.7 ]
Minimum permission level: read/write item
Applicable Outlook mode: Appointment Organizer
Examples
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/30-recipients-and-attendees/get-organizer-
appointment-organizer.yaml
Office.context.mailbox.item.organizer.getAsync(function(asyncResult) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
const apptOrganizer = asyncResult.value;
console.log("Organizer: " + apptOrganizer.displayName + " (" +
apptOrganizer.emailAddress + ")");
} else {
console.error(asyncResult.error);
}
});
recurrence
Gets or sets the recurrence pattern of an appointment.
The recurrence property returns a recurrence object for recurring appointments or
meetings requests if an item is a series or an instance in a series. null is returned for
single appointments and meeting requests of single appointments.
Note: Meeting requests have an itemClass value of IPM.Schedule.Meeting.Request .
Note: If the recurrence object is null, this indicates that the object is a single
appointment or a meeting request of a single appointment and NOT a part of a
series.
TypeScript
recurrence: Recurrence;
Property Value
Office.Recurrence
Remarks
[ API set: Mailbox 1.7 ]
Minimum permission level: read item
Applicable Outlook mode: Appointment Organizer
Examples
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/50-recurrence/get-set-recurrence-
appointment-organizer.yaml
Office.context.mailbox.item.recurrence.getAsync(function(asyncResult) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
const recurrence = asyncResult.value;
if (recurrence === null) {
console.log("This is a single appointment.");
} else {
console.log(`Recurrence pattern: ${JSON.stringify(recurrence)}`);
}
} else {
console.error(asyncResult.error);
}
});
...
// Important: Can only set the recurrence pattern of an appointment
series.
const currentDate = new Date();
let seriesTimeObject: Office.SeriesTime;
// Set series start date to tomorrow.
seriesTimeObject.setStartDate(currentDate.getFullYear(),
currentDate.getMonth(), currentDate.getDay() + 1);
// Set series end date to one year from now.
seriesTimeObject.setEndDate(currentDate.getFullYear() + 1,
currentDate.getMonth() + 1, currentDate.getDay());
// Set start time to 1:30 PM.
seriesTimeObject.setStartTime(13, 30);
// Set duration to 30 minutes.
seriesTimeObject.setDuration(30);
const pattern: Office.Recurrence = {
seriesTime: seriesTimeObject,
recurrenceType: Office.MailboxEnums.RecurrenceType.Yearly,
recurrenceProperties: {
interval: 1,
dayOfWeek: Office.MailboxEnums.Days.Tue,
weekNumber: Office.MailboxEnums.WeekNumber.Second,
month: Office.MailboxEnums.Month.Sep
},
recurrenceTimeZone: { name:
Office.MailboxEnums.RecurrenceTimeZone.PacificStandardTime }
};
Office.context.mailbox.item.recurrence.setAsync(pattern, (asyncResult) =>
{
if (asyncResult.status !== Office.AsyncResultStatus.Succeeded) {
console.error(`Failed to set recurrence. Error:
${asyncResult.error.message}`);
return;
}
console.log(`Succeeded in setting recurrence pattern
${JSON.stringify(pattern)}`);
});
requiredAttendees
Provides access to the required attendees of an event. The type of object and level of
access depend on the mode of the current item.
The requiredAttendees property returns a Recipients object that provides methods
to get or update the required attendees for a meeting. However, depending on the
client/platform (i.e., Windows, Mac, etc.), limits may apply on how many recipients
you can get or update. See the Recipients object for more details.
TypeScript
requiredAttendees: Recipients;
Property Value
Office.Recipients
Remarks
Minimum permission level: read item
Applicable Outlook mode: Appointment Organizer
Examples
TypeScript
Office.context.mailbox.item.requiredAttendees.setAsync(
['[email protected]', '[email protected]'] );
Office.context.mailbox.item.requiredAttendees.addAsync(
['[email protected]'] );
Office.context.mailbox.item.requiredAttendees.getAsync(callback);
function callback(asyncResult) {
const arrayOfRequiredAttendeesRecipients = asyncResult.value;
console.log(JSON.stringify(arrayOfRequiredAttendeesRecipients));
}
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/30-recipients-and-attendees/get-set-
required-attendees-appointment-organizer.yaml
Office.context.mailbox.item.requiredAttendees.getAsync(function(asyncResu
lt) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
const apptRequiredAttendees = asyncResult.value;
for (let i = 0; i < apptRequiredAttendees.length; i++) {
console.log(
"Required attendees: " +
apptRequiredAttendees[i].displayName +
" (" +
apptRequiredAttendees[i].emailAddress +
") - response: " +
apptRequiredAttendees[i].appointmentResponse
);
}
} else {
console.error(asyncResult.error);
}
});
...
const email = $("#emailRequired")
.val()
.toString();
const emailArray = [email];
Office.context.mailbox.item.requiredAttendees.setAsync(emailArray,
function(asyncResult) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
console.log("Succeeded in setting required attendees field.");
} else {
console.error(asyncResult.error);
}
});
seriesId
Gets the ID of the series that an instance belongs to.
In Outlook on the web and desktop clients, the seriesId property returns the
Exchange Web Services (EWS) ID of the parent (series) item that this item belongs to.
However, on iOS and Android, the seriesId returns the REST ID of the parent item.
Note: The identifier returned by the seriesId property is the same as the Exchange
Web Services item identifier. The seriesId property is not identical to the Outlook
IDs used by the Outlook REST API. Before making REST API calls using this value, it
should be converted using Office.context.mailbox.convertToRestId . For more
details, see Use the Outlook REST APIs from an Outlook add-in.
The seriesId property returns null for items that do not have parent items such as
single appointments, series items, or meeting requests and returns undefined for any
other items that are not meeting requests.
TypeScript
seriesId: string;
Property Value
string
Remarks
[ API set: Mailbox 1.7 ]
Minimum permission level: read item
Applicable Outlook mode: Appointment Organizer
Examples
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/50-recurrence/get-series-id.yaml
const seriesId = Office.context.mailbox.item.seriesId;
if (seriesId === undefined) {
console.log("This is a message that's not a meeting request.");
} else if (seriesId === null) {
console.log("This is a single appointment, a parent series, or a
meeting request for a series or single meeting.");
} else {
console.log("This is an instance belonging to series with ID " +
seriesId);
}
sessionData
Manages the SessionData of an item in Compose mode.
Important: The entire SessionData object is limited to 50,000 characters per add-in.
TypeScript
sessionData: SessionData;
Property Value
Office.SessionData
Remarks
[ API set: Mailbox 1.11 ]
Minimum permission level: read item
Applicable Outlook mode: Appointment Organizer
Examples
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/90-other-item-apis/session-data-apis.yaml
Office.context.mailbox.item.sessionData.getAllAsync(function(asyncResult)
{
if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
console.log("The sessionData is " +
JSON.stringify(asyncResult.value));
} else {
console.log("Failed to get all sessionData. Error: " +
JSON.stringify(asyncResult.error));
}
});
start
Gets or sets the date and time that the appointment is to begin.
The start property is a Time object expressed as a Coordinated Universal Time
(UTC) date and time value. You can use the convertToLocalClientTime method to
convert the value to the client's local date and time.
When you use the Time.setAsync method to set the start time, you should use the
convertToUtcClientTime method to convert the local time on the client to UTC for
the server.
Important: In the Windows client, you can't use this property to update the start of a
recurrence.
TypeScript
start: Time;
Property Value
Office.Time
Remarks
Minimum permission level: read item
Applicable Outlook mode: Appointment Organizer
Examples
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/90-other-item-apis/get-set-start-
appointment-organizer.yaml
Office.context.mailbox.item.start.getAsync((result) => {
if (result.status !== Office.AsyncResultStatus.Succeeded) {
console.error(`Action failed with message ${result.error.message}`);
return;
}
console.log(`Appointment starts: ${result.value}`);
});
...
const start = new Date(); // Represents current date and time.
start.setDate(start.getDate() + 2); // Add 2 days to current date.
Office.context.mailbox.item.start.setAsync(start, (result) => {
if (result.status !== Office.AsyncResultStatus.Succeeded) {
console.error(`Action failed with message ${result.error.message}`);
return;
}
console.log(`Successfully set start date and time to ${start}`);
});
subject
Gets or sets the description that appears in the subject field of an item.
The subject property gets or sets the entire subject of the item, as sent by the email
server.
The subject property returns a Subject object that provides methods to get and set
the subject.
TypeScript
subject: Subject;
Property Value
Office.Subject
Remarks
Minimum permission level: read item
Applicable Outlook mode: Appointment Organizer
Examples
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/90-other-item-apis/get-set-subject-
compose.yaml
Office.context.mailbox.item.subject.getAsync((result) => {
if (result.status !== Office.AsyncResultStatus.Succeeded) {
console.error(`Action failed with message ${result.error.message}`);
return;
}
console.log(`Subject: ${result.value}`);
});
...
let subject = "Hello World!";
Office.context.mailbox.item.subject.setAsync(subject, (result) => {
if (result.status !== Office.AsyncResultStatus.Succeeded) {
console.error(`Action failed with message ${result.error.message}`);
return;
}
console.log(`Successfully set subject to ${subject}`);
});
Method Details
addFileAttachmentAsync(uri, attachmentName, options,
callback)
Adds a file to a message or appointment as an attachment.
The addFileAttachmentAsync method uploads the file at the specified URI and
attaches it to the item in the compose form.
You can subsequently use the identifier with the removeAttachmentAsync method to
remove the attachment in the same session.
Important: In recent builds of Outlook on Windows, a bug was introduced that
incorrectly appends an Authorization: Bearer header to this action (whether using
this API or the Outlook UI). To work around this issue, you can try using the
addFileAttachmentFromBase64 API introduced with requirement set 1.8.
TypeScript
addFileAttachmentAsync(uri: string, attachmentName: string, options:
Office.AsyncContextOptions & { isInline: boolean }, callback?:
(asyncResult: Office.AsyncResult<string>) => void): void;
Parameters
uri string
The URI that provides the location of the file to attach to the message or
appointment. The maximum length is 2048 characters.
attachmentName string
The name of the attachment that is shown while the attachment is uploading. The
maximum length is 255 characters.
options Office.AsyncContextOptions & { isInline: boolean }
An object literal that contains one or more of the following properties:-
asyncContext : Developers can provide any object they wish to access in the callback
function. isInline : If true, indicates that the attachment will be shown inline in the
message body, and should not be displayed in the attachment list.
callback (asyncResult: Office.AsyncResult<string>) => void
Optional. When the method completes, the function passed in the callback
parameter is called with a single parameter of type Office.AsyncResult . On success,
the attachment identifier will be provided in the asyncResult.value property. If
uploading the attachment fails, the asyncResult object will contain an Error object
that provides a description of the error.
Returns
void
Remarks
[ API set: Mailbox 1.1 ]
Minimum permission level: read/write item
Applicable Outlook mode: Appointment Organizer
Errors:
AttachmentSizeExceeded : The attachment is larger than allowed.
FileTypeNotSupported : The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded : The message or appointment has too many
attachments.
Examples
TypeScript
function callback(result) {
if (result.error) {
console.log(result.error);
} else {
console.log("Attachment added");
}
}
function addAttachment() {
// The values in asyncContext can be accessed in the callback.
const options = { 'asyncContext': { var1: 1, var2: 2 } };
const attachmentURL = "https://contoso.com/rtm/icon.png";
Office.context.mailbox.item.addFileAttachmentAsync(attachmentURL,
attachmentURL, options, callback);
}
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/40-attachments/attachments-compose.yaml
const attachmentUrl = $("#attachmentUrl").val();
Office.context.mailbox.item.addFileAttachmentAsync(
attachmentUrl,
getFileName(attachmentUrl),
{ "asyncContext" : { var1: 1, var2: true } },
function(result) { console.log(result); });
addFileAttachmentAsync(uri, attachmentName, callback)
Adds a file to a message or appointment as an attachment.
The addFileAttachmentAsync method uploads the file at the specified URI and
attaches it to the item in the compose form.
You can subsequently use the identifier with the removeAttachmentAsync method to
remove the attachment in the same session.
Important: In recent builds of Outlook on Windows, a bug was introduced that
incorrectly appends an Authorization: Bearer header to this action (whether using
this API or the Outlook UI). To work around this issue, you can try using the
addFileAttachmentFromBase64 API introduced with requirement set 1.8.
TypeScript
addFileAttachmentAsync(uri: string, attachmentName: string, callback?:
(asyncResult: Office.AsyncResult<string>) => void): void;
Parameters
uri string
The URI that provides the location of the file to attach to the message or
appointment. The maximum length is 2048 characters.
attachmentName string
The name of the attachment that is shown while the attachment is uploading. The
maximum length is 255 characters.
callback (asyncResult: Office.AsyncResult<string>) => void
Optional. When the method completes, the function passed in the callback
parameter is called with a single parameter of type Office.AsyncResult . On success,
the attachment identifier will be provided in the asyncResult.value property. If
uploading the attachment fails, the asyncResult object will contain an Error object
that provides a description of the error.
Returns
void
Remarks
[ API set: Mailbox 1.1 ]
Minimum permission level: read/write item
Applicable Outlook mode: Appointment Organizer
Errors:
AttachmentSizeExceeded : The attachment is larger than allowed.
FileTypeNotSupported : The attachment has an extension that is not allowed.
NumberOfAttachmentsExceeded : The message or appointment has too many
attachments.
addFileAttachmentFromBase64Async(base64File,
attachmentName, options, callback)
Adds a file to a message or appointment as an attachment.
The addFileAttachmentFromBase64Async method uploads the file from the Base64
encoding and attaches it to the item in the compose form. This method returns the
attachment identifier in the asyncResult.value object.
You can subsequently use the identifier with the removeAttachmentAsync method to
remove the attachment in the same session.
Note: If you're using a data URL API (e.g., readAsDataURL ), you need to strip out the
data URL prefix then send the rest of the string to this API. For example, if the full
string is represented by data:image/svg+xml;base64,<rest of Base64 string> ,
remove data:image/svg+xml;base64, .
TypeScript
addFileAttachmentFromBase64Async(base64File: string, attachmentName:
string, options: Office.AsyncContextOptions & { isInline: boolean },
callback?: (asyncResult: Office.AsyncResult<string>) => void): void;
Parameters
base64File string
The Base64-encoded content of an image or file to be added to an email or event.
The maximum length of the encoded string is 27,892,122 characters (about 25 MB).
attachmentName string
The name of the attachment that is shown while the attachment is uploading. The
maximum length is 255 characters.
options Office.AsyncContextOptions & { isInline: boolean }
An object literal that contains one or more of the following properties:-
asyncContext : Developers can provide any object they wish to access in the callback
function. isInline : If true, indicates that the attachment will be shown inline in the
message body and should not be displayed in the attachment list.
callback (asyncResult: Office.AsyncResult<string>) => void
Optional. When the method completes, the function passed in the callback
parameter is called with a single parameter of type Office.AsyncResult . On success,
the attachment identifier will be provided in the asyncResult.value property. If
uploading the attachment fails, the asyncResult object will contain an Error object
that provides a description of the error.
Returns
void
Remarks
[ API set: Mailbox 1.8 ]
Minimum permission level: read/write item
Applicable Outlook mode: Appointment Organizer
Errors:
AttachmentSizeExceeded : The attachment is larger than allowed.
FileTypeNotSupported : The attachment has an extension that isn't allowed.
NumberOfAttachmentsExceeded : The message or appointment has too many
attachments.
Note: If you're adding an inline Base64 image to the body of a message or
appointment being composed, you must first get the current item body using the
Office.context.mailbox.item.body.getAsync method before inserting the image using
addFileAttachmentFromBase64Async . Otherwise, the image won't render in the body
once it's inserted. For further guidance, see Attach a file.
Examples
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/40-attachments/attachments-compose.yaml
base64String =
"iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAAsSAAALEgHS3X78
AAACRUlEQVRYw82XzXHbMBCFP2F8tzsQc8Ixyh0zoiuIXIGdCsxUYKqC0B04FdiuwMoM7mGOO
IXqQGoAymXhgSX+itJM9kIRFLAP+3YXD5Pdbscx5oxaAIW8Ztr6l2PWmQwF4IyaieP53qdfAq
Q8CwBn1JU4vpWhrbxXQA5MZfynANmcDIAzKgcy4FKGXsVJFf3nLgKyBQptfT4KQMRz2N0fcbx
qmRMDWXflx0VPnrdArq0vekQ1Dv0UeHZGNebHhwjU8AzwKM43RyZnbAf58Q6ghudeWd0Aus0+
5EcMIIRi3beua0D3Nm39BEAx3i7HTK4DEBJn5YxKOnaRA5+ErpMBWMpzDvx1RuXCcxOISlufA
jfC7zgAsqsvUvMAD0ApPaEtGi9AIlUzKgJo60tt/SyKRkzLrAXERluf7W1gOICWaMyB386ooo
OWsIHvXbSoHuUSFovtHqicUVnH3EJoeT0aQEf5/XBGlc6otIOWBXAtPeZkAIJ9Bt6cUU9tZau
tX2nrk3MACHYr1ZKProKRtDw4o8pzAPjWo+NtpXTTvoteDDg8noDAcwbcRedAkGdFXyk2GEDc
egVAFp2gyVDHjRQ4o6q2smoqtR5Hd+qMqtoALCWUUymr1m43QMZfOaMK4C0SrMsDANJ2E5FNc
bdbjHC+ENl+H0myJFbLtaq4Rt8dyPBYRQV1E40nMv9rl7xrOw3DGb+Whcqu3i/OM6CUOWvgRl
ufNmnLYy4m77uJI7AXtdNcTDrU71LEyv7v01/N/ovL6bmu5/8A1tNWZldH0W4AAAAASUVORK5
CYII=";
Office.context.mailbox.item.addFileAttachmentFromBase64Async(
base64String,
"logo.png",
{ isInline: false },
function(result) { console.log(result); });
...
// Set the signature for the current item with inline image.
const modIcon1Base64 =
"iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAAGXRFWHRTb2Z0d2FyZQBBZG9i
ZSBJbWFnZVJlYWR5ccllPAAAA2ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tld
CBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldG
EgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1
jMDYxIDY0LjE0MDk0OSwgMjAxMC8xMi8wNy0xMDo1NzowMSAgICAgICAgIj4gPHJkZjpSREYg
eG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjI
j4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy
5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29
tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9i
ZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDpDRDMxM
Dg1MjBCNDZFMTExODE2MkM1RUI2M0M4MDYxRCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZD
pFMTUxQjgyRjQ2MEQxMUUxODlFMkQwNTYzQ0YwMTUxMiIgeG1wTU06SW5zdGFuY2VJRD0ieG1
wLmlpZDpFMTUxQjgyRTQ2MEQxMUUxODlFMkQwNTYzQ0YwMTUxMiIgeG1wOkNyZWF0b3JUb29s
PSJBZG9iZSBQaG90b3Nob3AgQ1M1LjEgV2luZG93cyI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzd
FJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkQxMzEwODUyMEI0NkUxMTE4MTYyQzVFQjYzQzgwNj
FEIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkNEMzEwODUyMEI0NkUxMTE4MTYyQzVFQjY
zQzgwNjFEIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8
P3hwYWNrZXQgZW5kPSJyIj8+uC/WfAAAAehJREFUeNpilCzfwEAEkAbiECA2A2J1IOaHin8E4
ptAfBaIVwLxU0IGMRKw0B6IW4DYhoE4cASIK6E0VsCEQ1wUiNcB8QESLGOAqj0MxBuhZhBloS
4QnwHiQAbygR/UDF1CFupCXSjHQDmQg5qli8tCUBBsQUoQ1AD8UDNFsVk4n0o+w+bT+egWglK
jNymmeGhLkqLcG2oHAwtUoIuQDj5OVgZPLUmwRe5aEmAxqYqNpFgKssOcCeplM0KqdST5GfpD
DRm0JfkYrj3/SE7QguyQY4ImYYLgCtAS10kHGMw6dzNsv/qC7OwCClJXYlR++v6b4er3j5QmI
FcmaNlIL6AOslCIjhYKMTHQGTBBqxh6gXcgC6/R0cKbIAv30dHCfaAKGJTxHxJSqS3Fz9Dkow
NmywpyMcgA8fF7b8D8VWcfM6w8+4gYC+VB+RCk8hSh0gaUD4/dewvlvUWRe/z+GzGWgex4BGt
iOAHxXhoHpzMoSGHZAhSPW2lo2VZYWkHOh4nEtLrIAE+hZmNUwK+B2BOIv1PRsu9QM1/jatNc
BtVZ0IREKXgENesyoVYbzNIdFFi2A5tl+NqlL6BB4QBNzsSCU1A9nlAzMAALAQMOQl0qB23qW
wKxIlIrDBQ394H4OBCvISYqAAIMACVibHDqsO7zAAAAAElFTkSuQmCC";
Office.context.mailbox.item.addFileAttachmentFromBase64Async(
modIcon1Base64,
"myImage.png",
{ isInline: true },
function(result) {
if (result.status == Office.AsyncResultStatus.Succeeded) {
const signature = $("#signature").val() + "<img
src='cid:myImage.png'>";
console.log(`Setting signature to "${signature}".`);
Office.context.mailbox.item.body.setSignatureAsync(
signature,
{ coercionType: "html" },
function(asyncResult) {
console.log(`setSignatureAsync: ${asyncResult.status}`);
}
);
} else {
console.error(`addFileAttachmentFromBase64Async: ${result.error}`);
}
}
);
addFileAttachmentFromBase64Async(base64File,
attachmentName, callback)
Adds a file to a message or appointment as an attachment.
The addFileAttachmentFromBase64Async method uploads the file from the Base64
encoding and attaches it to the item in the compose form. This method returns the
attachment identifier in the asyncResult.value object.
You can subsequently use the identifier with the removeAttachmentAsync method to
remove the attachment in the same session.
Note: If you're using a data URL API (e.g., readAsDataURL ), you need to strip out the
data URL prefix then send the rest of the string to this API. For example, if the full
string is represented by data:image/svg+xml;base64,<rest of Base64 string> ,
remove data:image/svg+xml;base64, .
TypeScript
addFileAttachmentFromBase64Async(base64File: string, attachmentName:
string, callback?: (asyncResult: Office.AsyncResult<string>) => void):
void;
Parameters
base64File string
The Base64-encoded content of an image or file to be added to an email or event.
The maximum length of the encoded string is 27,892,122 characters (about 25 MB).
attachmentName string
The name of the attachment that is shown while the attachment is uploading. The
maximum length is 255 characters.
callback (asyncResult: Office.AsyncResult<string>) => void
Optional. When the method completes, the function passed in the callback
parameter is called with a single parameter of type Office.AsyncResult . On success,
the attachment identifier will be provided in the asyncResult.value property. If
uploading the attachment fails, the asyncResult object will contain an Error object
that provides a description of the error.
Returns
void
Remarks
[ API set: Mailbox 1.8 ]
Minimum permission level: read/write item
Applicable Outlook mode: Appointment Organizer
Errors:
AttachmentSizeExceeded : The attachment is larger than allowed.
FileTypeNotSupported : The attachment has an extension that isn't allowed.
NumberOfAttachmentsExceeded : The message or appointment has too many
attachments.
Note: If you're adding an inline Base64 image to the body of a message or
appointment being composed, you must first get the current item body using the
Office.context.mailbox.item.body.getAsync method before inserting the image using
addFileAttachmentFromBase64Async . Otherwise, the image won't render in the body
once it's inserted. For further guidance, see Attach a file.
addHandlerAsync(eventType, handler, options, callback)
Adds an event handler for a supported event. Note: Events are only available with
task pane implementation.
For supported events, refer to the Item object model events section.
TypeScript
addHandlerAsync(eventType: Office.EventType | string, handler: any,
options: Office.AsyncContextOptions, callback?: (asyncResult:
Office.AsyncResult<void>) => void): void;
Parameters
eventType Office.EventType | string
The event that should invoke the handler.
handler any
The function to handle the event. The function must accept a single parameter,
which is an object literal. The type property on the parameter will match the
eventType parameter passed to addHandlerAsync .
options Office.AsyncContextOptions
An object literal that contains one or more of the following properties:-
asyncContext : Developers can provide any object they wish to access in the callback
function.
callback (asyncResult: Office.AsyncResult<void>) => void
Optional. When the method completes, the function passed in the callback
parameter is called with a single parameter, asyncResult , which is an
Office.AsyncResult object.
Returns
void
Remarks
[ API set: Mailbox 1.7 ]
Minimum permission level: read item
Applicable Outlook mode: Appointment Organizer
Examples
TypeScript
function myHandlerFunction(eventarg) {
if (eventarg.attachmentStatus ===
Office.MailboxEnums.AttachmentStatus.Added) {
const attachment = eventarg.attachmentDetails;
console.log("Event Fired and Attachment Added!");
getAttachmentContentAsync(attachment.id, options, callback);
}
}
Office.context.mailbox.item.addHandlerAsync(Office.EventType.AttachmentsC
hanged, myHandlerFunction, myCallback);
addHandlerAsync(eventType, handler, callback)
Adds an event handler for a supported event. Note: Events are only available with
task pane implementation.
For supported events, refer to the Item object model events section.
TypeScript
addHandlerAsync(eventType: Office.EventType | string, handler: any,
callback?: (asyncResult: Office.AsyncResult<void>) => void): void;
Parameters
eventType Office.EventType | string
The event that should invoke the handler.
handler any
The function to handle the event. The function must accept a single parameter,
which is an object literal. The type property on the parameter will match the
eventType parameter passed to addHandlerAsync .
callback (asyncResult: Office.AsyncResult<void>) => void
Optional. When the method completes, the function passed in the callback
parameter is called with a single parameter, asyncResult , which is an
Office.AsyncResult object.
Returns
void
Remarks
[ API set: Mailbox 1.7 ]
Minimum permission level: read item
Applicable Outlook mode: Appointment Organizer
addItemAttachmentAsync(itemId, attachmentName,
options, callback)
Adds an Exchange item, such as a message, as an attachment to the message or
appointment.
The addItemAttachmentAsync method attaches the item with the specified Exchange
identifier to the item in the compose form. If you specify a callback function, the
method is called with one parameter, asyncResult , which contains either the
attachment identifier or a code that indicates any error that occurred while attaching
the item. You can use the options parameter to pass state information to the
callback function, if needed.
You can subsequently use the identifier with the removeAttachmentAsync method to
remove the attachment in the same session.
If your Office Add-in is running in Outlook on the web, the addItemAttachmentAsync
method can attach items to items other than the item that you are editing; however,
this is not supported and is not recommended.
TypeScript
addItemAttachmentAsync(itemId: any, attachmentName: string, options:
Office.AsyncContextOptions, callback?: (asyncResult:
Office.AsyncResult<string>) => void): void;
Parameters
itemId any
The Exchange identifier of the item to attach. The maximum length is 100 characters.
attachmentName string
The name of the attachment that is shown while the attachment is uploading. The
maximum length is 255 characters.
options Office.AsyncContextOptions
An object literal that contains one or more of the following properties:-
asyncContext : Developers can provide any object they wish to access in the callback
function.
callback (asyncResult: Office.AsyncResult<string>) => void
Optional. When the method completes, the function passed in the callback
parameter is called with a single parameter of type Office.AsyncResult . On success,
the attachment identifier will be provided in the asyncResult.value property. If
adding the attachment fails, the asyncResult object will contain an Error object that
provides a description of the error.
Returns
void
Remarks
[ API set: Mailbox 1.1 ]
Minimum permission level: read/write item
Applicable Outlook mode: Appointment Organizer
Errors:
NumberOfAttachmentsExceeded : The message or appointment has too many
attachments.
Examples
TypeScript
// The following example adds an existing Outlook item as an attachment
// with the name `My Attachment`.
function callback(result) {
if (result.error) {
console.log(result.error);
} else {
console.log("Attachment added");
}
}
function addAttachment() {
// EWS ID of item to attach (shortened for readability).
const itemId = "AAMkADI1...AAA=";
// The values in asyncContext can be accessed in the callback.
const options = { 'asyncContext': { var1: 1, var2: 2 } };
Office.context.mailbox.item.addItemAttachmentAsync(itemId, "My
Attachment", options, callback);
}
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/40-attachments/attachments-compose.yaml
const attachmentItemId = $("#attachmentItemId").val();
Office.context.mailbox.item.addItemAttachmentAsync(
attachmentItemId,
"My attachment",
{ "asyncContext" : { var3: 3, var4: false } },
function(result) { console.log(result); });
addItemAttachmentAsync(itemId, attachmentName,
callback)
Adds an Exchange item, such as a message, as an attachment to the message or
appointment.
The addItemAttachmentAsync method attaches the item with the specified Exchange
identifier to the item in the compose form. If you specify a callback function, the
method is called with one parameter, asyncResult , which contains either the
attachment identifier or a code that indicates any error that occurred while attaching
the item. You can use the options parameter to pass state information to the
callback function, if needed.
You can subsequently use the identifier with the removeAttachmentAsync method to
remove the attachment in the same session.
If your Office Add-in is running in Outlook on the web, the addItemAttachmentAsync
method can attach items to items other than the item that you are editing; however,
this is not supported and is not recommended.
TypeScript
addItemAttachmentAsync(itemId: any, attachmentName: string, callback?:
(asyncResult: Office.AsyncResult<string>) => void): void;
Parameters
itemId any
The Exchange identifier of the item to attach. The maximum length is 100 characters.
attachmentName string
The name of the attachment that is shown while the attachment is uploading. The
maximum length is 255 characters.
callback (asyncResult: Office.AsyncResult<string>) => void
Optional. When the method completes, the function passed in the callback
parameter is called with a single parameter of type Office.AsyncResult . On success,
the attachment identifier will be provided in the asyncResult.value property. If
adding the attachment fails, the asyncResult object will contain an Error object that
provides a description of the error.
Returns
void
Remarks
[ API set: Mailbox 1.1 ]
Minimum permission level: read/write item
Applicable Outlook mode: Appointment Organizer
Errors:
NumberOfAttachmentsExceeded : The message or appointment has too many
attachments.
close()
Closes the current item that is being composed.
The behavior of the close method depends on the current state of the item being
composed. If the item has unsaved changes, the client prompts the user to save,
discard, or close the action.
In the Outlook desktop client, the close method has no effect on a reply in the
Reading Pane.
TypeScript
close(): void;
Returns
void
Remarks
[ API set: Mailbox 1.3 ]
Minimum permission level: restricted
Applicable Outlook mode: Appointment Organizer
Important: In Outlook on the web, if the item is an appointment and it has
previously been saved using saveAsync , the user is prompted to save, discard, or
cancel even if no changes have occurred since the item was last saved.
Examples
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/25-item-save-and-close/close.yaml
Office.context.mailbox.item.close();
disableClientSignatureAsync(options, callback)
Disables the Outlook client signature.
For Windows and Mac rich clients, this API sets the signature under the "New
Message" and "Replies/Forwards" sections for the sending account to "(none)",
effectively disabling the signature. For Outlook on the web, the API should disable
the signature option for new mails, replies, and forwards. If the signature is selected,
this API call should disable it.
TypeScript
disableClientSignatureAsync(options: Office.AsyncContextOptions,
callback?: (asyncResult: Office.AsyncResult<void>) => void): void;
Parameters
options Office.AsyncContextOptions
An object literal that contains one or more of the following properties:-
asyncContext : Developers can provide any object they wish to access in the callback
function.
callback (asyncResult: Office.AsyncResult<void>) => void
Optional. When the method completes, the function passed in the callback
parameter is called with a single parameter, asyncResult , which is an
Office.AsyncResult object.
Returns
void
Remarks
[ API set: Mailbox 1.10 ]
Minimum permission level: read/write item
Applicable Outlook mode: Appointment Organizer
Examples
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/90-other-item-apis/work-with-client-
signatures.yaml
// Disable the client signature.
Office.context.mailbox.item.disableClientSignatureAsync(function(asyncRes
ult) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
console.log("disableClientSignatureAsync succeeded");
} else {
console.error(asyncResult.error);
}
});
disableClientSignatureAsync(callback)
Disables the Outlook client signature.
For Windows and Mac rich clients, this API sets the signature under the "New
Message" and "Replies/Forwards" sections for the sending account to "(none)",
effectively disabling the signature. For Outlook on the web, the API should disable
the signature option for new mails, replies, and forwards. If the signature is selected,
this API call should disable it.
TypeScript
disableClientSignatureAsync(callback?: (asyncResult:
Office.AsyncResult<void>) => void): void;
Parameters
callback (asyncResult: Office.AsyncResult<void>) => void
Optional. When the method completes, the function passed in the callback
parameter is called with a single parameter, asyncResult , which is an
Office.AsyncResult object.
Returns
void
Remarks
[ API set: Mailbox 1.10 ]
Minimum permission level: read/write item
Applicable Outlook mode: Appointment Organizer
getAttachmentContentAsync(attachmentId, options,
callback)
Gets an attachment from a message or appointment and returns it as an
AttachmentContent object.
The getAttachmentContentAsync method gets the attachment with the specified
identifier from the item. As a best practice, you should get the attachment's identifier
from a getAttachmentsAsync call, then in the same session, use that identifier to
retrieve the attachment. In Outlook on the web and mobile devices, the attachment
identifier is valid only within the same session. A session is over when the user closes
the app, or if the user starts composing an inline form then subsequently pops out
the form to continue in a separate window.
TypeScript
getAttachmentContentAsync(attachmentId: string, options:
Office.AsyncContextOptions, callback?: (asyncResult:
Office.AsyncResult<AttachmentContent>) => void): void;
Parameters
attachmentId string
The identifier of the attachment you want to get.
options Office.AsyncContextOptions
An object literal that contains one or more of the following properties:-
asyncContext : Developers can provide any object they wish to access in the callback
function.
callback (asyncResult: Office.AsyncResult<Office.AttachmentContent>) => void
Optional. When the method completes, the function passed in the callback
parameter is called with a single parameter, asyncResult , which is an
Office.AsyncResult object. If the call fails, the asyncResult.error property will
contain an error code with the reason for the failure.
Returns
void
Remarks
[ API set: Mailbox 1.8 ]
Minimum permission level: read item
Applicable Outlook mode: Appointment Organizer
Errors:
AttachmentTypeNotSupported : The attachment type isn't supported.
Unsupported types include embedded images in Rich Text Format, or item
attachment types other than email or calendar items (such as a contact or task
item).
InvalidAttachmentId : The attachment identifier does not exist.
Examples
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/40-attachments/get-attachment-content.yaml
// Gets the attachments of the current message or appointment in compose
mode.
const options = { asyncContext: { currentItem: item } };
// The getAttachmentsAsync call can only be used in compose mode.
item.getAttachmentsAsync(options, callback);
function callback(result) {
if (result.status === Office.AsyncResultStatus.Failed) {
console.log(result.error.message);
return;
}
if (result.value.length <= 0) {
console.log("Mail item has no attachments.");
return;
}
for (let i = 0; i < result.value.length; i++) {
// Log the attachment type and its contents to the console.
result.asyncContext.currentItem.getAttachmentContentAsync(result.value[i]
.id, handleAttachmentsCallback);
}
}
getAttachmentContentAsync(attachmentId, callback)
Gets an attachment from a message or appointment and returns it as an
AttachmentContent object.
The getAttachmentContentAsync method gets the attachment with the specified
identifier from the item. As a best practice, you should get the attachment's identifier
from a getAttachmentsAsync call, then in the same session, use that identifier to
retrieve the attachment. In Outlook on the web and mobile devices, the attachment
identifier is valid only within the same session. A session is over when the user closes
the app, or if the user starts composing an inline form then subsequently pops out
the form to continue in a separate window.
TypeScript
getAttachmentContentAsync(attachmentId: string, callback?: (asyncResult:
Office.AsyncResult<AttachmentContent>) => void): void;
Parameters
attachmentId string
The identifier of the attachment you want to get.
callback (asyncResult: Office.AsyncResult<Office.AttachmentContent>) => void
Optional. When the method completes, the function passed in the callback
parameter is called with a single parameter, asyncResult , which is an
Office.AsyncResult object. If the call fails, the asyncResult.error property will
contain an error code with the reason for the failure.
Returns
void
Remarks
[ API set: Mailbox 1.8 ]
Minimum permission level: read item
Applicable Outlook mode: Appointment Organizer
Errors:
AttachmentTypeNotSupported : The attachment type isn't supported.
Unsupported types include embedded images in Rich Text Format, or item
attachment types other than email or calendar items (such as a contact or task
item).
InvalidAttachmentId : The attachment identifier does not exist.
getAttachmentsAsync(options, callback)
Gets the item's attachments as an array.
TypeScript
getAttachmentsAsync(options: Office.AsyncContextOptions, callback?:
(asyncResult: Office.AsyncResult<AttachmentDetailsCompose[]>) => void):
void;
Parameters
options Office.AsyncContextOptions
An object literal that contains one or more of the following properties:-
asyncContext : Developers can provide any object they wish to access in the callback
function.
callbac (asyncResult: Office.AsyncResult<Office.AttachmentDetailsCompose[]>)
k => void
Optional. When the method completes, the function passed in the callback
parameter is called with a single parameter of type Office.AsyncResult . If the call
fails, the asyncResult.error property will contain an error code with the reason for
the failure.
Returns
void
Remarks
[ API set: Mailbox 1.8 ]
Minimum permission level: read item
Applicable Outlook mode: Appointment Organizer
Examples
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/40-attachments/attachments-compose.yaml
Office.context.mailbox.item.getAttachmentsAsync(function (result) {
if (result.status !== Office.AsyncResultStatus.Succeeded) {
console.error(result.error.message);
} else {
if (result.value.length > 0) {
for (let i = 0; i < result.value.length; i++) {
const attachment = result.value[i];
console.log("ID: " + attachment.id + "\n" +
"Name: " + attachment.name + "\n" +
"Size: " + attachment.size + "\n" +
"isInline: " + attachment.isInline);
switch (attachment.attachmentType) {
case Office.MailboxEnums.AttachmentType.Cloud:
console.log("Attachment type: Attachment is
stored in a cloud location.");
break;
case Office.MailboxEnums.AttachmentType.File:
console.log("Attachment type: Attachment is a
file.");
break;
case Office.MailboxEnums.AttachmentType.Item:
console.log("Attachment type: Attachment is an
Exchange item.");
break;
}
}
}
else {
console.log("No attachments on this message.");
}
}
});
getAttachmentsAsync(callback)
Gets the item's attachments as an array.
TypeScript
getAttachmentsAsync(callback?: (asyncResult:
Office.AsyncResult<AttachmentDetailsCompose[]>) => void): void;
Parameters
callbac (asyncResult: Office.AsyncResult<Office.AttachmentDetailsCompose[]>)
k => void
Optional. When the method completes, the function passed in the callback
parameter is called with a single parameter of type Office.AsyncResult . If the call
fails, the asyncResult.error property will contain an error code with the reason for
the failure.
Returns
void
Remarks
[ API set: Mailbox 1.8 ]
Minimum permission level: read item
Applicable Outlook mode: Appointment Organizer
getInitializationContextAsync(options, callback)
Gets initialization data passed when the add-in is activated by an actionable
message.
TypeScript
getInitializationContextAsync(options: Office.AsyncContextOptions,
callback: (asyncResult: Office.AsyncResult<string>) => void): void;
Parameters
options Office.AsyncContextOptions
An object literal that contains one or more of the following properties:-
asyncContext : Developers can provide any object they wish to access in the callback
function.
callback (asyncResult: Office.AsyncResult<string>) => void
When the method completes, the function passed in the callback parameter is
called with a single parameter of type Office.AsyncResult . On success, the
initialization context data is provided as a string (or an empty string if there's no
initialization context) in the asyncResult.value property.
Returns
void
Remarks
[ API set: Mailbox 1.8 ]
Minimum permission level: read item
Applicable Outlook mode: Appointment Organizer
Examples
TypeScript
// Get the initialization context (if present).
Office.context.mailbox.item.getInitializationContextAsync((asyncResult)
=> {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
if (asyncResult.value.length > 0) {
// The value is a string, parse to an object.
const context = JSON.parse(asyncResult.value);
// Do something with context.
} else {
// Empty context, treat as no context.
}
} else {
// Handle the error.
}
});
getInitializationContextAsync(callback)
Gets initialization data passed when the add-in is activated by an actionable
message.
TypeScript
getInitializationContextAsync(callback: (asyncResult:
Office.AsyncResult<string>) => void): void;
Parameters
callback (asyncResult: Office.AsyncResult<string>) => void
When the method completes, the function passed in the callback parameter is
called with a single parameter of type Office.AsyncResult . On success, the
initialization context data is provided as a string (or an empty string if there's no
initialization context) in the asyncResult.value property.
Returns
void
Remarks
[ API set: Mailbox 1.8 ]
Minimum permission level: read item
Applicable Outlook mode: Appointment Organizer
getItemIdAsync(options, callback)
Asynchronously gets the ID of a saved item.
When invoked, this method returns the item ID via the callback function.
Note: If your add-in calls getItemIdAsync on an item in compose mode (e.g., to get
an itemId to use with EWS or the REST API), be aware that when Outlook is in
cached mode, it may take some time before the item is synced to the server. Until
the item is synced, the itemId is not recognized and using it returns an error.
TypeScript
getItemIdAsync(options: Office.AsyncContextOptions, callback:
(asyncResult: Office.AsyncResult<string>) => void): void;
Parameters
options Office.AsyncContextOptions
An object literal that contains one or more of the following properties:-
asyncContext : Developers can provide any object they wish to access in the callback
function.
callback (asyncResult: Office.AsyncResult<string>) => void
When the method completes, the function passed in the callback parameter is
called with a single parameter of type Office.AsyncResult .
Returns
void
Remarks
[ API set: Mailbox 1.8 ]
Minimum permission level: read item
Applicable Outlook mode: Appointment Organizer
Errors:
ItemNotSaved : The ID can't be retrieved until the item is saved.
getItemIdAsync(callback)
Asynchronously gets the ID of a saved item.
When invoked, this method returns the item ID via the callback function.
Note: If your add-in calls getItemIdAsync on an item in compose mode (e.g., to get
an itemId to use with EWS or the REST API), be aware that when Outlook is in
cached mode, it may take some time before the item is synced to the server. Until
the item is synced, the itemId is not recognized and using it returns an error.
TypeScript
getItemIdAsync(callback: (asyncResult: Office.AsyncResult<string>) =>
void): void;
Parameters
callback (asyncResult: Office.AsyncResult<string>) => void
When the method completes, the function passed in the callback parameter is
called with a single parameter of type Office.AsyncResult .
Returns
void
Remarks
[ API set: Mailbox 1.8 ]
Minimum permission level: read item
Applicable Outlook mode: Appointment Organizer
Errors:
ItemNotSaved : The ID can't be retrieved until the item is saved.
Examples
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/85-tokens-and-service-calls/item-id-
compose.yaml
Office.context.mailbox.item.getItemIdAsync(function (result) {
if (result.status !== Office.AsyncResultStatus.Succeeded) {
console.error(`getItemIdAsync failed with message:
${result.error.message}`);
} else {
console.log(result.value);
}
});
getSelectedDataAsync(coercionType, options, callback)
Asynchronously returns selected data from the subject or body of a message.
If there is no selection but the cursor is in the body or subject, the method returns an
empty string for the selected data. If a field other than the body or subject is
selected, the method returns the InvalidSelection error.
To access the selected data from the callback function, call asyncResult.value.data .
To access the source property that the selection comes from, call
asyncResult.value.sourceProperty , which will be either body or subject .
TypeScript
getSelectedDataAsync(coercionType: Office.CoercionType | string, options:
Office.AsyncContextOptions, callback: (asyncResult:
Office.AsyncResult<any>) => void): void;
Parameters
coercionType Office.CoercionType | string
Requests a format for the data. If Text , the method returns the plain text as a string,
removing any HTML tags present. If HTML , the method returns the selected text,
whether it is plaintext or HTML.
options Office.AsyncContextOptions
An object literal that contains one or more of the following properties:-
asyncContext : Developers can provide any object they wish to access in the callback
function.
callback (asyncResult: Office.AsyncResult<any>) => void
When the method completes, the function passed in the callback parameter is
called with a single parameter of type Office.AsyncResult .
Returns
void
The selected data as a string with format determined by coercionType .
Remarks
[ API set: Mailbox 1.2 ]
Minimum permission level: read item
Applicable Outlook mode: Appointment Organizer
Examples
TypeScript
// Get selected data.
Office.initialize = function () {
Office.context.mailbox.item.getSelectedDataAsync(Office.CoercionType.Text
, {}, getCallback);
};
function getCallback(asyncResult) {
const text = asyncResult.value.data;
const prop = asyncResult.value.sourceProperty;
console.log("Selected text in " + prop + ": " + text);
}
getSelectedDataAsync(coercionType, callback)
Asynchronously returns selected data from the subject or body of a message.
If there is no selection but the cursor is in the body or subject, the method returns an
empty string for the selected data. If a field other than the body or subject is
selected, the method returns the InvalidSelection error.
To access the selected data from the callback function, call asyncResult.value.data .
To access the source property that the selection comes from, call
asyncResult.value.sourceProperty , which will be either body or subject .
TypeScript
getSelectedDataAsync(coercionType: Office.CoercionType | string,
callback: (asyncResult: Office.AsyncResult<string>) => void): void;
Parameters
coercionType Office.CoercionType | string
Requests a format for the data. If Text , the method returns the plain text as a string,
removing any HTML tags present. If HTML , the method returns the selected text,
whether it is plaintext or HTML.
callback (asyncResult: Office.AsyncResult<string>) => void
When the method completes, the function passed in the callback parameter is
called with a single parameter of type Office.AsyncResult .
Returns
void
The selected data as a string with format determined by coercionType .
Remarks
[ API set: Mailbox 1.2 ]
Minimum permission level: read item
Applicable Outlook mode: Appointment Organizer
Examples
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/20-item-body/get-selected-data.yaml
Office.context.mailbox.item.getSelectedDataAsync(Office.CoercionType.Text
, function(asyncResult) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
const text = asyncResult.value.data;
const prop = asyncResult.value.sourceProperty;
console.log("Selected text in " + prop + ": " + text);
} else {
console.error(asyncResult.error);
}
});
getSharedPropertiesAsync(options, callback)
Gets the properties of an appointment or message in a shared folder or shared
mailbox.
For more information around using this API, see Enable shared folders and shared
mailbox scenarios in an Outlook add-in.
TypeScript
getSharedPropertiesAsync(options: Office.AsyncContextOptions, callback:
(asyncResult: Office.AsyncResult<SharedProperties>) => void): void;
Parameters
options Office.AsyncContextOptions
An object literal that contains one or more of the following properties:-
asyncContext : Developers can provide any object they wish to access in the callback
function.
callback (asyncResult: Office.AsyncResult<Office.SharedProperties>) => void
When the method completes, the function passed in the callback parameter is
called with a single parameter, asyncResult , which is an Office.AsyncResult object.
The asyncResult.value property provides the properties of the shared item.
Returns
void
Remarks
[ API set: Mailbox 1.8 for shared folder support, Mailbox 1.13 for shared mailbox
support ]
Minimum permission level: read item
Applicable Outlook mode: Appointment Organizer
Note*: This method is not supported in Outlook on iOS or Android.
Examples
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/65-delegates-and-shared-folders/get-shared-
properties.yaml
if (!Office.context.mailbox.item.getSharedPropertiesAsync) {
console.error("Try this sample on an appointment from a shared
folder.");
return;
}
Office.context.mailbox.getCallbackTokenAsync({ isRest: true },
function(result) {
if (result.status === Office.AsyncResultStatus.Succeeded &&
result.value !== "") {
Office.context.mailbox.item.getSharedPropertiesAsync(
{
// Pass auth token along.
asyncContext: result.value
},
function(result2) {
let sharedProperties = result2.value;
let delegatePermissions = sharedProperties.delegatePermissions;
// Determine if user has the appropriate permission to do the
operation.
if ((delegatePermissions &
Office.MailboxEnums.DelegatePermissions.Read) != 0) {
const ewsId = Office.context.mailbox.item.itemId;
const restId = Office.context.mailbox.convertToRestId(ewsId,
Office.MailboxEnums.RestVersion.v2_0);
let rest_url =
sharedProperties.targetRestUrl + "/v2.0/users/" +
sharedProperties.targetMailbox + "/events/" + restId;
$.ajax({
url: rest_url,
dataType: "json",
headers: { Authorization: "Bearer " + result2.asyncContext }
})
.done(function(response) {
console.log(response);
})
.fail(function(error) {
console.error(error);
});
}
}
);
}
});
getSharedPropertiesAsync(callback)
Gets the properties of an appointment or message in a shared folder or shared
mailbox.
For more information around using this API, see Enable shared folders and shared
mailbox scenarios in an Outlook add-in.
TypeScript
getSharedPropertiesAsync(callback: (asyncResult:
Office.AsyncResult<SharedProperties>) => void): void;
Parameters
callback (asyncResult: Office.AsyncResult<Office.SharedProperties>) => void
When the method completes, the function passed in the callback parameter is
called with a single parameter, asyncResult , which is an Office.AsyncResult object.
The asyncResult.value property provides the properties of the shared item.
Returns
void
Remarks
[ API set: Mailbox 1.8 for shared folder support, Mailbox 1.13 for shared mailbox
support ]
Minimum permission level: read item
Applicable Outlook mode: Appointment Organizer
Note*: This method is not supported in Outlook on iOS or Android.
Examples
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/65-delegates-and-shared-folders/get-shared-
properties.yaml
if (!Office.context.mailbox.item.getSharedPropertiesAsync) {
console.error("Try this sample on an item from a shared folder.");
return;
}
Office.context.mailbox.item.getSharedPropertiesAsync(function(result) {
console.log(result.value);
});
isClientSignatureEnabledAsync(options, callback)
Gets if the client signature is enabled.
For Windows and Mac rich clients, the API call should return true if the default
signature for new messages, replies, or forwards is set to a template for the sending
Outlook account. For Outlook on the web, the API call should return true if the
signature is enabled for compose types newMail , reply , or forward . If the settings
are set to "(none)" in Mac or Windows rich clients or disabled in Outlook on the
Web, the API call should return false .
TypeScript
isClientSignatureEnabledAsync(options: Office.AsyncContextOptions,
callback: (asyncResult: Office.AsyncResult<boolean>) => void): void;
Parameters
options Office.AsyncContextOptions
An object literal that contains one or more of the following properties:-
asyncContext : Developers can provide any object they wish to access in the callback
function.
callback (asyncResult: Office.AsyncResult<boolean>) => void
When the method completes, the function passed in the callback parameter is
called with a single parameter of type Office.AsyncResult .
Returns
void
Remarks
[ API set: Mailbox 1.10 ]
Minimum permission level: read item
Applicable Outlook mode: Appointment Organizer
Examples
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/90-other-item-apis/work-with-client-
signatures.yaml
// Check if the client signature is currently enabled.
Office.context.mailbox.item.isClientSignatureEnabledAsync(function(asyncR
esult) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
console.log("isClientSignatureEnabledAsync succeeded with result: " +
asyncResult.value);
} else {
console.error(asyncResult.error);
}
});
isClientSignatureEnabledAsync(callback)
Gets if the client signature is enabled.
For Windows and Mac rich clients, the API call should return true if the default
signature for new messages, replies, or forwards is set to a template for the sending
Outlook account. For Outlook on the web, the API call should return true if the
signature is enabled for compose types newMail , reply , or forward . If the settings
are set to "(none)" in Mac or Windows rich clients or disabled in Outlook on the
Web, the API call should return false .
TypeScript
isClientSignatureEnabledAsync(callback: (asyncResult:
Office.AsyncResult<boolean>) => void): void;
Parameters
callback (asyncResult: Office.AsyncResult<boolean>) => void
When the method completes, the function passed in the callback parameter is
called with a single parameter of type Office.AsyncResult .
Returns
void
Remarks
[ API set: Mailbox 1.10 ]
Minimum permission level: read item
Applicable Outlook mode: Appointment Organizer
loadCustomPropertiesAsync(callback, userContext)
Asynchronously loads custom properties for this add-in on the selected item.
Custom properties are stored as key-value pairs on a per-app, per-item basis. This
method returns a CustomProperties object in the callback, which provides methods
to access the custom properties specific to the current item and the current add-in.
Custom properties aren't encrypted on the item, so this shouldn't be used as secure
storage.
The custom properties are provided as a CustomProperties object in the
asyncResult.value property. This object can be used to get, set, save, and remove
custom properties from the mail item.
TypeScript
loadCustomPropertiesAsync(callback: (asyncResult:
Office.AsyncResult<CustomProperties>) => void, userContext?: any): void;
Parameters
callback (asyncResult: Office.AsyncResult<Office.CustomProperties>) => void
When the method completes, the function passed in the callback parameter is
called with a single parameter of type Office.AsyncResult .
userContext any
Optional. Developers can provide any object they wish to access in the callback
function. This object can be accessed by the asyncResult.asyncContext property in
the callback function.
Returns
void
Remarks
[ API set: Mailbox 1.1 ]
To learn more about custom properties, see Get and set add-in metadata for an
Outlook add-in.
Minimum permission level: read item
Applicable Outlook mode: Appointment Organizer
Examples
TypeScript
// The following example shows how to use the loadCustomPropertiesAsync
method
// to asynchronously load custom properties that are specific to the
current item.
// The example also shows how to use the saveAsync method to save these
properties
// back to the server. After loading the custom properties, the example
uses the
// get method to read the custom property myProp, the set method to write
the
// custom property otherProp, and then finally calls the saveAsync method
to save
// the custom properties.
Office.initialize = function () {
// Checks for the DOM to load using the jQuery ready method.
$(document).ready(function () {
// After the DOM is loaded, add-in-specific code can run.
const mailbox = Office.context.mailbox;
mailbox.item.loadCustomPropertiesAsync(customPropsCallback);
});
};
function customPropsCallback(asyncResult) {
const customProps = asyncResult.value;
const myProp = customProps.get("myProp");
customProps.set("otherProp", "value");
customProps.saveAsync(saveCallback);
}
function saveCallback(asyncResult) {
}
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/15-item-custom-properties/load-set-get-
save.yaml
Office.context.mailbox.item.loadCustomPropertiesAsync(function (result) {
if (result.status === Office.AsyncResultStatus.Succeeded) {
console.log("Loaded following custom properties:");
customProps = result.value;
const dataKey = Object.keys(customProps)[0];
const data = customProps[dataKey];
for (let propertyName in data)
{
let propertyValue = data[propertyName];
console.log(`${propertyName}: ${propertyValue}`);
}
}
else {
console.error(`loadCustomPropertiesAsync failed with message
${result.error.message}`);
}
});
removeAttachmentAsync(attachmentId, options, callback)
Removes an attachment from a message or appointment.
The removeAttachmentAsync method removes the attachment with the specified
identifier from the item. As a best practice, you should use the attachment identifier
to remove an attachment only if the same mail app has added that attachment in the
same session. In Outlook on the web and mobile devices, the attachment identifier is
valid only within the same session. A session is over when the user closes the app, or
if the user starts composing an inline form then subsequently pops out the form to
continue in a separate window.
TypeScript
removeAttachmentAsync(attachmentId: string, options:
Office.AsyncContextOptions, callback?: (asyncResult:
Office.AsyncResult<void>) => void): void;
Parameters
attachmentId string
The identifier of the attachment to remove. The maximum string length of the
attachmentId is 200 characters in Outlook on the web and on Windows.
options Office.AsyncContextOptions
An object literal that contains one or more of the following properties:-
asyncContext : Developers can provide any object they wish to access in the callback
function.
callback (asyncResult: Office.AsyncResult<void>) => void
Optional. When the method completes, the function passed in the callback
parameter is called with a single parameter of type Office.AsyncResult . If removing
the attachment fails, the asyncResult.error property will contain an error code with
the reason for the failure.
Returns
void
Remarks
[ API set: Mailbox 1.1 ]
Minimum permission level: read/write item
Applicable Outlook mode: Appointment Organizer
Errors:
InvalidAttachmentId : The attachment identifier does not exist.
Examples
TypeScript
// The following code removes an attachment with an identifier of '0'.
Office.context.mailbox.item.removeAttachmentAsync(
'0',
{ asyncContext : null },
function (asyncResult)
{
console.log(asyncResult.status);
}
);
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/40-attachments/attachments-compose.yaml
Office.context.mailbox.item.removeAttachmentAsync(
$("#attachmentId").val(),
{ asyncContext : null },
function(result)
{
if (result.status !== Office.AsyncResultStatus.Succeeded) {
console.error(`${result.error.message}`);
} else {
console.log(`Attachment removed successfully.`);
}
}
);
removeAttachmentAsync(attachmentId, callback)
Removes an attachment from a message or appointment.
The removeAttachmentAsync method removes the attachment with the specified
identifier from the item. As a best practice, you should use the attachment identifier
to remove an attachment only if the same mail app has added that attachment in the
same session. In Outlook on the web and mobile devices, the attachment identifier is
valid only within the same session. A session is over when the user closes the app, or
if the user starts composing an inline form then subsequently pops out the form to
continue in a separate window.
TypeScript
removeAttachmentAsync(attachmentId: string, callback?: (asyncResult:
Office.AsyncResult<void>) => void): void;
Parameters
attachmentId string
The identifier of the attachment to remove. The maximum string length of the
attachmentId is 200 characters in Outlook on the web and on Windows.
callback (asyncResult: Office.AsyncResult<void>) => void
Optional. When the method completes, the function passed in the callback
parameter is called with a single parameter of type Office.AsyncResult . If removing
the attachment fails, the asyncResult.error property will contain an error code with
the reason for the failure.
Returns
void
Remarks
[ API set: Mailbox 1.1 ]
Minimum permission level: read/write item
Applicable Outlook mode: Appointment Organizer
Errors:
InvalidAttachmentId : The attachment identifier does not exist.
removeHandlerAsync(eventType, options, callback)
Removes the event handlers for a supported event type. Note: Events are only
available with task pane implementation.
For supported events, refer to the Item object model events section.
TypeScript
removeHandlerAsync(eventType: Office.EventType | string, options:
Office.AsyncContextOptions, callback?: (asyncResult:
Office.AsyncResult<void>) => void): void;
Parameters
eventType Office.EventType | string
The event that should revoke the handler.
options Office.AsyncContextOptions
An object literal that contains one or more of the following properties:-
asyncContext : Developers can provide any object they wish to access in the callback
function.
callback (asyncResult: Office.AsyncResult<void>) => void
Optional. When the method completes, the function passed in the callback
parameter is called with a single parameter, asyncResult , which is an
Office.AsyncResult object.
Returns
void
Remarks
[ API set: Mailbox 1.7 ]
Minimum permission level: read item
Applicable Outlook mode: Appointment Organizer
removeHandlerAsync(eventType, callback)
Removes the event handlers for a supported event type. Note: Events are only
available with task pane implementation.
For supported events, refer to the Item object model events section.
TypeScript
removeHandlerAsync(eventType: Office.EventType | string, callback?:
(asyncResult: Office.AsyncResult<void>) => void): void;
Parameters
eventType Office.EventType | string
The event that should revoke the handler.
callback (asyncResult: Office.AsyncResult<void>) => void
Optional. When the method completes, the function passed in the callback
parameter is called with a single parameter, asyncResult , which is an
Office.AsyncResult object.
Returns
void
Remarks
[ API set: Mailbox 1.7 ]
Minimum permission level: read item
Applicable Outlook mode: Appointment Organizer
saveAsync(options, callback)
Asynchronously saves an item.
When invoked, this method saves the current message as a draft and returns the
item ID via the callback function. In Outlook on the web or Outlook in online mode,
the item is saved to the server. In Outlook in cached mode, the item is saved to the
local cache.
Since appointments have no draft state, if saveAsync is called on an appointment in
compose mode, the item will be saved as a normal appointment on the user's
calendar. For new appointments that have not been saved before, no invitation will
be sent. Saving an existing appointment will send an update to added or removed
attendees.
When working with HTML-formatted content, it's important to note that the Outlook
client may modify the content. This means that subsequent calls to methods like
Body.getAsync , Body.setAsync , and even saveAsync may not result in the same
content.
Note: If your add-in calls saveAsync on an item in compose mode in order to get an
item ID to use with EWS or the REST API, be aware that when Outlook is in cached
mode, it may take some time before the item is actually synced to the server. Until
the item is synced, using the item ID will return an error.
Note: In Outlook on Mac, only build 16.35.308 or later supports saving a meeting.
Otherwise, the saveAsync method fails when called from a meeting in compose
mode. For a workaround, see Cannot save a meeting as a draft in Outlook for Mac by
using Office JS API.
TypeScript
saveAsync(options: Office.AsyncContextOptions, callback: (asyncResult:
Office.AsyncResult<string>) => void): void;
Parameters
options Office.AsyncContextOptions
An object literal that contains one or more of the following properties:-
asyncContext : Developers can provide any object they wish to access in the callback
function.
callback (asyncResult: Office.AsyncResult<string>) => void
When the method completes, the function passed in the callback parameter is
called with a single parameter of type Office.AsyncResult .
Returns
void
Remarks
[ API set: Mailbox 1.3 ]
Minimum permission level: read/write item
Applicable Outlook mode: Appointment Organizer
Errors:
InvalidAttachmentId : The attachment identifier does not exist.
Examples
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/25-item-save-and-close/save.yaml
Office.context.mailbox.item.saveAsync(function (result) {
if (result.status === Office.AsyncResultStatus.Succeeded) {
console.log(`saveAsync succeeded, itemId is ${result.value}`);
}
else {
console.error(`saveAsync failed with message
${result.error.message}`);
}
});
saveAsync(callback)
Asynchronously saves an item.
When invoked, this method saves the current message as a draft and returns the
item ID via the callback function. In Outlook on the web or Outlook in online mode,
the item is saved to the server. In Outlook in cached mode, the item is saved to the
local cache.
Since appointments have no draft state, if saveAsync is called on an appointment in
compose mode, the item will be saved as a normal appointment on the user's
calendar. For new appointments that have not been saved before, no invitation will
be sent. Saving an existing appointment will send an update to added or removed
attendees.
When working with HTML-formatted content, it's important to note that the Outlook
client may modify the content. This means that subsequent calls to methods like
Body.getAsync , Body.setAsync , and even saveAsync may not result in the same
content.
Note: If your add-in calls saveAsync on an item in compose mode in order to get an
item ID to use with EWS or the REST API, be aware that when Outlook is in cached
mode, it may take some time before the item is actually synced to the server. Until
the item is synced, using the item ID will return an error.
Note: In Outlook on Mac, only build 16.35.308 or later supports saving a meeting.
Otherwise, the saveAsync method fails when called from a meeting in compose
mode. For a workaround, see Cannot save a meeting as a draft in Outlook for Mac by
using Office JS API.
TypeScript
saveAsync(callback: (asyncResult: Office.AsyncResult<string>) => void):
void;
Parameters
callback (asyncResult: Office.AsyncResult<string>) => void
When the method completes, the function passed in the callback parameter is called
with a single parameter of type Office.AsyncResult .
Returns
void
Remarks
[ API set: Mailbox 1.3 ]
Minimum permission level: read/write item
Applicable Outlook mode: Appointment Organizer
Errors:
InvalidAttachmentId : The attachment identifier does not exist.
Examples
TypeScript
Office.context.mailbox.item.saveAsync(
function callback(result) {
// Process the result.
});
// The following is an example of the
// `result` parameter passed to the
// callback function. The `value`
// property contains the item ID of
// the item.
{
"value": "AAMkADI5...AAA=",
"status": "succeeded"
}
setSelectedDataAsync(data, options, callback)
Asynchronously inserts data into the body or subject of a message.
The setSelectedDataAsync method inserts the specified string at the cursor location
in the subject or body of the item, or, if text is selected in the editor, it replaces the
selected text. If the cursor is not in the body or subject field, an error is returned.
After insertion, the cursor is placed at the end of the inserted content.
TypeScript
setSelectedDataAsync(data: string, options: Office.AsyncContextOptions &
CoercionTypeOptions, callback?: (asyncResult: Office.AsyncResult<void>)
=> void): void;
Parameters
data string
The data to be inserted. Data is not to exceed 1,000,000 characters. If more than
1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown.
options Office.AsyncContextOptions & Office.CoercionTypeOptions
An object literal that contains one or more of the following properties:-
asyncContext : Developers can provide any object they wish to access in the callback
function. coercionType : If text, the current style is applied in Outlook on the web and
Windows. If the field is an HTML editor, only the text data is inserted, even if the data
is HTML. If html and the field supports HTML (the subject doesn't), the current style
is applied in Outlook on the web and the default style is applied in Outlook on
desktop clients. If the field is a text field, an InvalidDataFormat error is returned. If
coercionType is not set, the result depends on the field: if the field is HTML then
HTML is used; if the field is text, then plain text is used.
callback (asyncResult: Office.AsyncResult<void>) => void
Optional. When the method completes, the function passed in the callback
parameter is called with a single parameter of type Office.AsyncResult .
Returns
void
Remarks
[ API set: Mailbox 1.2 ]
Minimum permission level: read/write item
Applicable Outlook mode: Appointment Organizer
Errors:
InvalidAttachmentId : The attachment identifier does not exist.
Examples
TypeScript
Office.context.mailbox.item.setSelectedDataAsync("<b>Hello World!</b>", {
coercionType : "html" });
TypeScript
Office.context.mailbox.item.setSelectedDataAsync("Hello World!");
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/90-other-item-apis/set-selected-data.yaml
Office.context.mailbox.item.setSelectedDataAsync("Replaced",
function(asyncResult) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
console.log("Selected text has been updated successfully.");
} else {
console.error(asyncResult.error);
}
});
setSelectedDataAsync(data, callback)
Asynchronously inserts data into the body or subject of a message.
The setSelectedDataAsync method inserts the specified string at the cursor location
in the subject or body of the item, or, if text is selected in the editor, it replaces the
selected text. If the cursor is not in the body or subject field, an error is returned.
After insertion, the cursor is placed at the end of the inserted content.
TypeScript
setSelectedDataAsync(data: string, callback?: (asyncResult:
Office.AsyncResult<void>) => void): void;
Parameters
data string
The data to be inserted. Data is not to exceed 1,000,000 characters. If more than
1,000,000 characters are passed in, an ArgumentOutOfRange exception is thrown.
callback (asyncResult: Office.AsyncResult<void>) => void
Optional. When the method completes, the function passed in the callback
parameter is called with a single parameter of type Office.AsyncResult .
Returns
void
Remarks
[ API set: Mailbox 1.2 ]
Minimum permission level: read/write item
Applicable Outlook mode: Appointment Organizer
Errors:
InvalidAttachmentId : The attachment identifier does not exist.
Office.AppointmentRead interface
Reference
Package: outlook
The appointment attendee mode of Office.context.mailbox.item.
Important: This is an internal Outlook object, not directly exposed through existing
interfaces. You should treat this as a mode of Office.context.mailbox.item . For more
information, refer to the Object Model page.
Parent interfaces:
ItemRead
Appointment
Extends Office.Appointment
Properties
attachments Gets the item's attachments as an array.
body Gets an object that provides methods for manipulating the body
of an item.
categories Gets an object that provides methods for managing the item's
categories.
dateTimeCreated Gets the date and time that an item was created.
dateTimeModified Gets the date and time that an item was last modified.
Note: This member is not supported in Outlook on iOS or
Android.
end Gets the date and time that the appointment is to end.
The end property is a Date object expressed as a Coordinated
Universal Time (UTC) date and time value. You can use the
convertToLocalClientTime method to convert the end property
value to the client's local date and time.
When you use the Time.setAsync method to set the end time,
you should use the convertToUtcClientTime method to convert
the local time on the client to UTC for the server.
enhancedLocation Gets the locations of an appointment.
The enhancedLocation property returns an EnhancedLocation
object that allows you to get the set of locations (each
represented by a LocationDetails object) associated with the
appointment.
itemClass Gets the Exchange Web Services item class of the selected item.
You can create custom message classes that extends a default
message class, for example, a custom appointment message
class IPM.Appointment.Contoso .
itemId Gets the Exchange Web Services item identifier for the current
item.
The itemId property is not available in compose mode. If an
item identifier is required, the saveAsync method can be used to
save the item to the store, which will return the item identifier in
the asyncResult.value parameter in the callback function.
Note: The identifier returned by the itemId property is the same
as the Exchange Web Services item identifier. The itemId
property is not identical to the Outlook Entry ID or the ID used
by the Outlook REST API. Before making REST API calls using this
value, it should be converted using
Office.context.mailbox.convertToRestId . For more details, see
Use the Outlook REST APIs from an Outlook add-in.
itemType Gets the type of item that an instance represents.
The itemType property returns one of the ItemType enumeration
values, indicating whether the item object instance is a message
or an appointment.
location Gets the location of an appointment.
The location property returns a string that contains the location
of the appointment.
normalizedSubject Gets the subject of an item, with all prefixes removed (including
RE: and FWD:).
The normalizedSubject property gets the subject of the item,
with any standard prefixes (such as RE: and FW:) that are added
by email programs. To get the subject of the item with the
prefixes intact, use the subject property.
notificationMessages Gets the notification messages for an item.
optionalAttendees Provides access to the optional attendees of an event. The type
of object and level of access depend on the mode of the current
item.
The optionalAttendees property returns an array that contains
an EmailAddressDetails object for each optional attendee to the
meeting. Collection size limits:
Windows: 500 members
Classic Mac UI: 100 members
New Mac UI, web browser, Android: No limit
organizer Gets the meeting organizer's email properties.
recurrence Gets the recurrence pattern of an appointment. Gets the
recurrence pattern of a meeting request.
The recurrence property returns a Recurrence object for
recurring appointments or meetings requests if an item is a
series or an instance in a series. null is returned for single
appointments and meeting requests of single appointments.
Note: Meeting requests have an itemClass value of
IPM.Schedule.Meeting.Request .
Note: If the recurrence object is null, this indicates that the
object is a single appointment or a meeting request of a single
appointment and NOT a part of a series.
requiredAttendees Provides access to the required attendees of an event. The type
of object and level of access depend on the mode of the current
item.
The requiredAttendees property returns an array that contains
an EmailAddressDetails object for each required attendee to the
meeting. Collection size limits:
Windows: 500 members
Classic Mac UI: 100 members
New Mac UI, web browser, Android: No limit
seriesId Gets the ID of the series that an instance belongs to.
In Outlook on the web and desktop clients, the seriesId returns
the Exchange Web Services (EWS) ID of the parent (series) item
that this item belongs to. However, on iOS and Android, the
seriesId returns the REST ID of the parent item.
Note: The identifier returned by the seriesId property is the
same as the Exchange Web Services item identifier. The seriesId
property is not identical to the Outlook IDs used by the Outlook
REST API. Before making REST API calls using this value, it should
be converted using Office.context.mailbox.convertToRestId .
For more details, see Use the Outlook REST APIs from an
Outlook add-in.
The seriesId property returns null for items that do not have
parent items such as single appointments, series items, or
meeting requests and returns undefined for any other items that
are not meeting requests.
start Gets the date and time that the appointment is to begin.
The start property is a Date object expressed as a Coordinated
Universal Time (UTC) date and time value. You can use the
convertToLocalClientTime method to convert the value to the
client's local date and time.
subject Gets the description that appears in the subject field of an item.
The subject property gets or sets the entire subject of the item,
as sent by the email server.
The subject property returns a string. Use the
normalizedSubject property to get the subject minus any leading
prefixes such as RE: and FW:.
Methods
addHandlerAsync(eventType, Adds an event handler for a supported event. Note: Events are
handler, options, callback) only available with task pane implementation.
For supported events, refer to the Item object model events
section.
addHandlerAsync(eventType, Adds an event handler for a supported event. Note: Events are
handler, callback) only available with task pane implementation.
For supported events, refer to the Item object model events
section.
displayReplyAllForm(form Displays a reply form that includes either the sender and all
Data) recipients of the selected message or the organizer and all
attendees of the selected appointment.
In Outlook on the web, the reply form is displayed as a pop-out
form in the 3-column view and a pop-up form in the 2-column
or 1-column view.
If any of the string parameters exceed their limits,
displayReplyAllForm throws an exception.
When attachments are specified in the formData.attachments
parameter, Outlook attempts to download all attachments and
attach them to the reply form. If any attachments fail to be
added, an error is shown in the form UI. If this isn't possible, then
no error message is thrown.
Note: This method is not supported in Outlook on iOS or
Android.
displayReplyAllForm Displays a reply form that includes either the sender and all
Async(formData, options, recipients of the selected message or the organizer and all
callback) attendees of the selected appointment.
In Outlook on the web, the reply form is displayed as a pop-out
form in the 3-column view and a pop-up form in the 2-column
or 1-column view.
If any of the string parameters exceed their limits,
displayReplyAllFormAsync throws an exception.
When attachments are specified in the formData.attachments
parameter, Outlook attempts to download all attachments and
attach them to the reply form. If any attachments fail to be
added, an error is shown in the form UI. If this isn't possible, then
no error message is thrown.
Note: This method is not supported in Outlook on iOS or
Android.
displayReplyAllForm Displays a reply form that includes either the sender and all
Async(formData, callback) recipients of the selected message or the organizer and all
attendees of the selected appointment.
In Outlook on the web, the reply form is displayed as a pop-out
form in the 3-column view and a pop-up form in the 2-column
or 1-column view.
If any of the string parameters exceed their limits,
displayReplyAllFormAsync throws an exception.
When attachments are specified in the formData.attachments
parameter, Outlook attempts to download all attachments and
attach them to the reply form. If any attachments fail to be
added, an error is shown in the form UI. If this isn't possible, then
no error message is thrown.
Note: This method is not supported in Outlook on iOS or
Android.
displayReplyForm(formData) Displays a reply form that includes only the sender of the
selected message or the organizer of the selected appointment.
In Outlook on the web, the reply form is displayed as a pop-out
form in the 3-column view and a pop-up form in the 2-column
or 1-column view.
If any of the string parameters exceed their limits,
displayReplyForm throws an exception.
When attachments are specified in the formData.attachments
parameter, Outlook attempts to download all attachments and
attach them to the reply form. If any attachments fail to be
added, an error is shown in the form UI. If this isn't possible, then
no error message is thrown.
Note: This method is not supported in Outlook on iOS or
Android.
displayReplyFormAsync(form Displays a reply form that includes only the sender of the
Data, options, callback) selected message or the organizer of the selected appointment.
In Outlook on the web, the reply form is displayed as a pop-out
form in the 3-column view and a pop-up form in the 2-column
or 1-column view.
If any of the string parameters exceed their limits,
displayReplyFormAsync throws an exception.
When attachments are specified in the formData.attachments
parameter, Outlook attempts to download all attachments and
attach them to the reply form. If any attachments fail to be
added, an error is shown in the form UI. If this isn't possible, then
no error message is thrown.
Note: This method is not supported in Outlook on iOS or
Android.
displayReplyFormAsync(form Displays a reply form that includes only the sender of the
Data, callback) selected message or the organizer of the selected appointment.
In Outlook on the web, the reply form is displayed as a pop-out
form in the 3-column view and a pop-up form in the 2-column
or 1-column view.
If any of the string parameters exceed their limits,
displayReplyFormAsync throws an exception.
When attachments are specified in the formData.attachments
parameter, Outlook attempts to download all attachments and
attach them to the reply form. If any attachments fail to be
added, an error is shown in the form UI. If this isn't possible, then
no error message is thrown.
Note: This method is not supported in Outlook on iOS or
Android.
getAttachmentContent Gets an attachment from a message or appointment and returns
Async(attachmentId, options, it as an AttachmentContent object.
callback)
The getAttachmentContentAsync method gets the attachment
with the specified identifier from the item. As a best practice, you
should get the attachment's identifier from an item.attachments
call, then in the same session, use that identifier to retrieve the
attachment. In Outlook on the web and mobile devices, the
attachment identifier is valid only within the same session. A
session is over when the user closes the app, or if the user starts
composing an inline form then subsequently pops out the form
to continue in a separate window.
getAttachmentContent Gets an attachment from a message or appointment and returns
Async(attachmentId, callback) it as an AttachmentContent object.
The getAttachmentContentAsync method gets the attachment
with the specified identifier from the item. As a best practice, you
should get the attachment's identifier from an item.attachments
call, then in the same session, use that identifier to retrieve the
attachment. In Outlook on the web and mobile devices, the
attachment identifier is valid only within the same session. A
session is over when the user closes the app, or if the user starts
composing an inline form then subsequently pops out the form
to continue in a separate window.
getEntities() Gets the entities found in the selected item's body.
Note: This method is not supported in Outlook on iOS or
Android.
getEntitiesByType(entityType) Gets an array of all the entities of the specified entity type found
in the selected item's body.
Note: This method is not supported in Outlook on iOS or
Android.
getFilteredEntities Returns well-known entities in the selected item that pass the
ByName(name) named filter defined in an XML manifest file.
Note: This method is used with the activation rules feature for
Outlook add-ins, which isn't supported by the Teams manifest
for Office Add-ins (preview).
The getFilteredEntitiesByName method returns the entities that
match the regular expression defined in the ItemHasKnownEntity
rule element in the manifest XML file with the specified
FilterName element value.
Note: This method is not supported in Outlook on iOS or
Android.
getInitializationContext Gets initialization data passed when the add-in is activated by an
Async(options, callback) actionable message.
getInitializationContext Gets initialization data passed when the add-in is activated by an
Async(callback) actionable message.
getRegExMatches() Returns string values in the selected item that match the regular
expressions defined in an XML manifest file.
Note: This method is used with the activation rules feature for
Outlook add-ins, which isn't supported by the Teams manifest
for Office Add-ins (preview).
The getRegExMatches method returns the strings that match the
regular expression defined in each
ItemHasRegularExpressionMatch or ItemHasKnownEntity rule
element in the manifest XML file. For an
ItemHasRegularExpressionMatch rule, a matching string has to
occur in the property of the item that is specified by that rule.
The PropertyName simple type defines the supported properties.
If you specify an ItemHasRegularExpressionMatch rule on the
body property of an item, the regular expression should further
filter the body and should not attempt to return the entire body
of the item. Using a regular expression such as .* to obtain the
entire body of an item does not always return the expected
results. Instead, use the Body.getAsync method to retrieve the
entire body.
Note: This method is not supported in Outlook on iOS or
Android.
getRegExMatches Returns string values in the selected item that match the named
ByName(name) regular expression defined in an XML manifest file.
Note: This method is used with the activation rules feature for
Outlook add-ins, which isn't supported by the Teams manifest
for Office Add-ins (preview).
The getRegExMatchesByName method returns the strings that
match the regular expression defined in the
ItemHasRegularExpressionMatch rule element in the manifest
XML file with the specified RegExName element value.
If you specify an ItemHasRegularExpressionMatch rule on the
body property of an item, the regular expression should further
filter the body and should not attempt to return the entire body
of the item. Using a regular expression such as .* to obtain the
entire body of an item does not always return the expected
results.
Note: This method is not supported in Outlook on iOS or
Android.
getSelectedEntities() Gets the entities found in a highlighted match a user has
selected. Highlighted matches apply to contextual add-ins.
Note: This method is used with the activation rules feature for
Outlook add-ins, which isn't supported by the Teams manifest
for Office Add-ins (preview).
Note: This method is not supported in Outlook on iOS or
Android.
getSelectedRegExMatches() Returns string values in a highlighted match that match the
regular expressions defined in an XML manifest file. Highlighted
matches apply to contextual add-ins.
Note: This method is used with the activation rules feature for
Outlook add-ins, which isn't supported by the Teams manifest
for Office Add-ins (preview).
The getSelectedRegExMatches method returns the strings that
match the regular expression defined in each
ItemHasRegularExpressionMatch or ItemHasKnownEntity rule
element in the manifest XML file. For an
ItemHasRegularExpressionMatch rule, a matching string has to
occur in the property of the item that is specified by that rule.
The PropertyName simple type defines the supported properties.
If you specify an ItemHasRegularExpressionMatch rule on the
body property of an item, the regular expression should further
filter the body and should not attempt to return the entire body
of the item. Using a regular expression such as .* to obtain the
entire body of an item does not always return the expected
results. Instead, use the Body.getAsync method to retrieve the
entire body.
Note: This method is not supported in Outlook on iOS or
Android.
getSharedProperties Gets the properties of an appointment or message in a shared
Async(options, callback) folder or shared mailbox.
For more information around using this API, see Enable shared
folders and shared mailbox scenarios in an Outlook add-in.
getSharedProperties Gets the properties of an appointment or message in a shared
Async(callback) folder or shared mailbox.
For more information around using this API, see Enable shared
folders and shared mailbox scenarios in an Outlook add-in.
loadCustomProperties Asynchronously loads custom properties for this add-in on the
Async(callback, userContext) selected item.
Custom properties are stored as key-value pairs on a per-app,
per-item basis. This method returns a CustomProperties object in
the callback, which provides methods to access the custom
properties specific to the current item and the current add-in.
Custom properties aren't encrypted on the item, so this
shouldn't be used as secure storage.
The custom properties are provided as a CustomProperties
object in the asyncResult.value property. This object can be
used to get, set, save, and remove custom properties from the
mail item.
removeHandlerAsync(event Removes the event handlers for a supported event type. Note:
Type, options, callback) Events are only available with task pane implementation.
For supported events, refer to the Item object model events
section.
removeHandlerAsync(event Removes the event handlers for a supported event type. Note:
Type, callback) Events are only available with task pane implementation.
For supported events, refer to the Item object model events
section.
Property Details
attachments
Gets the item's attachments as an array.
TypeScript
attachments: AttachmentDetails[];
Property Value
Office.AttachmentDetails[]
Remarks
Minimum permission level: read item
Applicable Outlook mode: Appointment Attendee
Note: Certain types of files are blocked by Outlook due to potential security issues
and are therefore not returned. For more information, see Blocked attachments in
Outlook .
Examples
TypeScript
// The following code builds an HTML string with details of all
attachments on the current item.
const item = Office.context.mailbox.item;
let outputString = "";
if (item.attachments.length > 0) {
for (let i = 0 ; i < item.attachments.length ; i++) {
const attachment = item.attachments[i];
outputString += "<BR>" + i + ". Name: ";
outputString += attachment.name;
outputString += "<BR>ID: " + attachment.id;
outputString += "<BR>contentType: " + attachment.contentType;
outputString += "<BR>size: " + attachment.size;
outputString += "<BR>attachmentType: " +
attachment.attachmentType;
outputString += "<BR>isInline: " + attachment.isInline;
}
}
console.log(outputString);
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/40-attachments/get-attachments-read.yaml
const attachments = Office.context.mailbox.item.attachments;
console.log(attachments);
body
Gets an object that provides methods for manipulating the body of an item.
TypeScript
body: Body;
Property Value
Office.Body
Remarks
[ API set: Mailbox 1.1 ]
Minimum permission level: read item
Applicable Outlook mode: Appointment Attendee
Examples
TypeScript
// This example gets the body of the item as plain text.
Office.context.mailbox.item.body.getAsync(
"text",
{ asyncContext: "This is passed to the callback" },
function callback(result) {
// Do something with the result.
});
// The following is an example of the result parameter passed to the
callback function.
{
"value": "TEXT of whole body (including threads below)",
"status": "succeeded",
"asyncContext": "This is passed to the callback"
}
categories
Gets an object that provides methods for managing the item's categories.
TypeScript
categories: Categories;
Property Value
Office.Categories
Remarks
[ API set: Mailbox 1.8 ]
Minimum permission level: read item
Applicable Outlook mode: Appointment Attendee
Examples
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/45-categories/work-with-categories.yaml
Office.context.mailbox.item.categories.getAsync(function(asyncResult) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
const categories = asyncResult.value;
if (categories && categories.length > 0) {
console.log("Categories assigned to this item:");
console.log(JSON.stringify(categories));
} else {
console.log("There are no categories assigned to this item.");
}
} else {
console.error(asyncResult.error);
}
});
...
// Note: In order for you to successfully add a category,
// it must be in the mailbox categories master list.
Office.context.mailbox.masterCategories.getAsync(function(asyncResult) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
const masterCategories = asyncResult.value;
if (masterCategories && masterCategories.length > 0) {
// Grab the first category from the master list.
const categoryToAdd = [masterCategories[0].displayName];
Office.context.mailbox.item.categories.addAsync(categoryToAdd,
function(asyncResult) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
console.log(`Successfully assigned category '${categoryToAdd}'
to item.`);
} else {
console.log("categories.addAsync call failed with error: " +
asyncResult.error.message);
}
});
} else {
console.log("There are no categories in the master list on this
mailbox. You can add categories using
Office.context.mailbox.masterCategories.addAsync.");
}
} else {
console.error(asyncResult.error);
}
});
...
Office.context.mailbox.item.categories.getAsync(function(asyncResult) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
const categories = asyncResult.value;
if (categories && categories.length > 0) {
// Grab the first category assigned to this item.
const categoryToRemove = [categories[0].displayName];
Office.context.mailbox.item.categories.removeAsync(categoryToRemove,
function(asyncResult) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
console.log(`Successfully unassigned category
'${categoryToRemove}' from this item.`);
} else {
console.log("categories.removeAsync call failed with error: " +
asyncResult.error.message);
}
});
} else {
console.log("There are no categories assigned to this item.");
}
} else {
console.error(asyncResult.error);
}
});
dateTimeCreated
Gets the date and time that an item was created.
TypeScript
dateTimeCreated: Date;
Property Value
Date
Remarks
Minimum permission level: read item
Applicable Outlook mode: Appointment Attendee
Examples
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/90-other-item-apis/get-date-time-created-
read.yaml
console.log(`Creation date and time:
${Office.context.mailbox.item.dateTimeCreated}`);
dateTimeModified
Gets the date and time that an item was last modified.
Note: This member is not supported in Outlook on iOS or Android.
TypeScript
dateTimeModified: Date;
Property Value
Date
Remarks
Minimum permission level: read item
Applicable Outlook mode: Appointment Attendee
Examples
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/90-other-item-apis/get-date-time-modified-
read.yaml
console.log(`Date and time item last modified:
${Office.context.mailbox.item.dateTimeModified}`);
end
Gets the date and time that the appointment is to end.
The end property is a Date object expressed as a Coordinated Universal Time (UTC)
date and time value. You can use the convertToLocalClientTime method to convert
the end property value to the client's local date and time.
When you use the Time.setAsync method to set the end time, you should use the
convertToUtcClientTime method to convert the local time on the client to UTC for
the server.
TypeScript
end: Date;
Property Value
Date
Remarks
Minimum permission level: read item
Applicable Outlook mode: Appointment Attendee
Examples
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/90-other-item-apis/get-end-read.yaml
console.log(`Appointment ends: ${Office.context.mailbox.item.end}`);
enhancedLocation
Gets the locations of an appointment.
The enhancedLocation property returns an EnhancedLocation object that allows you
to get the set of locations (each represented by a LocationDetails object) associated
with the appointment.
TypeScript
enhancedLocation: EnhancedLocation;
Property Value
Office.EnhancedLocation
Remarks
[ API set: Mailbox 1.8 ]
Minimum permission level: read item
Applicable Outlook mode: Appointment Attendee
Examples
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/90-other-item-apis/get-add-remove-
enhancedlocation-appointment.yaml
Office.context.mailbox.item.enhancedLocation.getAsync((result) => {
if (result.status !== Office.AsyncResultStatus.Succeeded) {
console.error(`Failed to get locations. Error message:
${result.error.message}`);
return;
}
const places = result.value;
if (places && places.length > 0) {
result.value.forEach(function(place) {
console.log(`Location: ${place.displayName} (type:
${place.locationIdentifier.type})`);
if (place.locationIdentifier.type ===
Office.MailboxEnums.LocationType.Room) {
console.log("Email address: " + place.emailAddress);
}
});
} else {
console.log("There are no locations.");
}
});
itemClass
Gets the Exchange Web Services item class of the selected item.
You can create custom message classes that extends a default message class, for
example, a custom appointment message class IPM.Appointment.Contoso .
TypeScript
itemClass: string;
Property Value
string
Remarks
Minimum permission level: read item
Applicable Outlook mode: Appointment Attendee
The itemClass property specifies the message class of the selected item. The
following are the default message classes for the message or appointment item.
Type Description Item Class
Appointment These are calendar items of the item IPM.Appointment,
items class IPM.Appointment or IPM.Appointment.Occurrence
IPM.Appointment.Occurrence.
Message These include email messages that have IPM.Note,
items the default message class IPM.Note, and IPM.Schedule.Meeting.Request,
meeting requests, responses, and IPM.Schedule.Meeting.Neg,
cancellations, that use IPM.Schedule.Meeting.Pos,
IPM.Schedule.Meeting as the base IPM.Schedule.Meeting.Tent,
message class. IPM.Schedule.Meeting.Canceled
Examples
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/90-other-item-apis/get-item-class-read.yaml
console.log(`Item class: ${Office.context.mailbox.item.itemClass}`);
itemId
Gets the Exchange Web Services item identifier for the current item.
The itemId property is not available in compose mode. If an item identifier is
required, the saveAsync method can be used to save the item to the store, which will
return the item identifier in the asyncResult.value parameter in the callback
function.
Note: The identifier returned by the itemId property is the same as the Exchange
Web Services item identifier. The itemId property is not identical to the Outlook
Entry ID or the ID used by the Outlook REST API. Before making REST API calls using
this value, it should be converted using Office.context.mailbox.convertToRestId .
For more details, see Use the Outlook REST APIs from an Outlook add-in.
TypeScript
itemId: string;
Property Value
string
Remarks
Minimum permission level: read item
Applicable Outlook mode: Appointment Attendee
Examples
TypeScript
// The following code checks for the presence of an item
// identifier. If the `itemId` property returns `null` or
// `undefined`, it saves the item to the store and gets the
// item identifier from the asynchronous result.
// **Important**: `saveAsync` was introduced with requirement set 1.3
// so you can't get the `itemId` in Compose mode in earlier sets.
let itemId = Office.context.mailbox.item.itemId;
if (itemId === null || itemId == undefined) {
Office.context.mailbox.item.saveAsync(function(result) {
itemId = result.value;
});
}
itemType
Gets the type of item that an instance represents.
The itemType property returns one of the ItemType enumeration values, indicating
whether the item object instance is a message or an appointment.
TypeScript
itemType: MailboxEnums.ItemType | string;
Property Value
Office.MailboxEnums.ItemType | string
Remarks
Minimum permission level: read item
Applicable Outlook mode: Appointment Attendee
Examples
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/90-other-item-apis/get-item-type.yaml
const itemType = Office.context.mailbox.item.itemType;
switch (itemType) {
case Office.MailboxEnums.ItemType.Appointment:
console.log(`Current item is an ${itemType}.`);
break;
case Office.MailboxEnums.ItemType.Message:
console.log(`Current item is a ${itemType}. A message could be an
email, meeting request, meeting response, or meeting cancellation.`);
break;
}
location
Gets the location of an appointment.
The location property returns a string that contains the location of the
appointment.
TypeScript
location: string;
Property Value
string
Remarks
Minimum permission level: read item
Applicable Outlook mode: Appointment Attendee
Examples
TypeScript
const location = Office.context.mailbox.item.location;
console.log("location: " + location);
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/90-other-item-apis/get-location-read.yaml
console.log(`Appointment location:
${Office.context.mailbox.item.location}`);
normalizedSubject
Gets the subject of an item, with all prefixes removed (including RE: and FWD:).
The normalizedSubject property gets the subject of the item, with any standard
prefixes (such as RE: and FW:) that are added by email programs. To get the subject
of the item with the prefixes intact, use the subject property.
TypeScript
normalizedSubject: string;
Property Value
string
Remarks
Minimum permission level: read item
Applicable Outlook mode: Appointment Attendee
Examples
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/90-other-item-apis/get-normalized-subject-
read.yaml
console.log(`Normalized subject:
${Office.context.mailbox.item.normalizedSubject}`);
notificationMessages
Gets the notification messages for an item.
TypeScript
notificationMessages: NotificationMessages;
Property Value
Office.NotificationMessages
Remarks
[ API set: Mailbox 1.3 ]
Minimum permission level: read item
Applicable Outlook mode: Appointment Attendee
Examples
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/35-notifications/add-getall-remove.yaml
const id = $("#notificationId").val();
const details =
{
type:
Office.MailboxEnums.ItemNotificationMessageType.ProgressIndicator,
message: "Progress indicator with id = " + id
};
Office.context.mailbox.item.notificationMessages.addAsync(id, details,
handleResult);
...
const id = $("#notificationId").val();
const details =
{
type:
Office.MailboxEnums.ItemNotificationMessageType.InformationalMessage,
message: "Non-persistent informational notification message with id =
" + id,
icon: "icon1",
persistent: false
};
Office.context.mailbox.item.notificationMessages.addAsync(id, details,
handleResult);
...
const id = $("#notificationId").val();
const details =
{
type:
Office.MailboxEnums.ItemNotificationMessageType.InformationalMessage,
message: "Persistent informational notification message with id = " +
id,
icon: "icon1",
persistent: true
};
Office.context.mailbox.item.notificationMessages.addAsync(id, details,
handleResult);
...
Office.context.mailbox.item.notificationMessages.getAllAsync(handleResult
);
...
const id = $("#notificationId").val();
Office.context.mailbox.item.notificationMessages.replaceAsync(
id,
{
type:
Office.MailboxEnums.ItemNotificationMessageType.InformationalMessage,
message: "Notification message with id = " + id + " has been replaced
with an informational message.",
icon: "icon2",
persistent: false
},
handleResult);
...
const id = $("#notificationId").val();
Office.context.mailbox.item.notificationMessages.removeAsync(id,
handleResult);
optionalAttendees
Provides access to the optional attendees of an event. The type of object and level of
access depend on the mode of the current item.
The optionalAttendees property returns an array that contains an
EmailAddressDetails object for each optional attendee to the meeting. Collection size
limits:
Windows: 500 members
Classic Mac UI: 100 members
New Mac UI, web browser, Android: No limit
TypeScript
optionalAttendees: EmailAddressDetails[];
Property Value
Office.EmailAddressDetails[]
Remarks
Minimum permission level: read item
Applicable Outlook mode: Appointment Attendee
Examples
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/30-recipients-and-attendees/get-optional-
attendees-appointment-attendee.yaml
const apptOptionalAttendees =
Office.context.mailbox.item.optionalAttendees;
console.log("Optional attendees:");
for (let i = 0; i < apptOptionalAttendees.length; i++) {
console.log(
apptOptionalAttendees[i].displayName +
" (" +
apptOptionalAttendees[i].emailAddress +
") - response: " +
apptOptionalAttendees[i].appointmentResponse
);
}
organizer
Gets the meeting organizer's email properties.
TypeScript
organizer: EmailAddressDetails;
Property Value
Office.EmailAddressDetails
Remarks
Minimum permission level: read item
Applicable Outlook mode: Appointment Attendee
Examples
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/30-recipients-and-attendees/get-organizer-
appointment-attendee.yaml
const apptOrganizer = Office.context.mailbox.item.organizer;
console.log("Organizer: " + apptOrganizer.displayName + " (" +
apptOrganizer.emailAddress + ")");
recurrence
Gets the recurrence pattern of an appointment. Gets the recurrence pattern of a
meeting request.
The recurrence property returns a Recurrence object for recurring appointments or
meetings requests if an item is a series or an instance in a series. null is returned for
single appointments and meeting requests of single appointments.
Note: Meeting requests have an itemClass value of IPM.Schedule.Meeting.Request .
Note: If the recurrence object is null, this indicates that the object is a single
appointment or a meeting request of a single appointment and NOT a part of a
series.
TypeScript
recurrence: Recurrence;
Property Value
Office.Recurrence
Remarks
[ API set: Mailbox 1.7 ]
Minimum permission level: read item
Applicable Outlook mode: Appointment Attendee
Examples
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/50-recurrence/get-recurrence-read.yaml
const recurrence = Office.context.mailbox.item.recurrence;
if (recurrence === undefined) {
console.log("This item is a message but not a meeting request.");
} else if (recurrence === null) {
console.log("This is a single appointment.");
} else {
console.log(JSON.stringify(recurrence));
}
requiredAttendees
Provides access to the required attendees of an event. The type of object and level of
access depend on the mode of the current item.
The requiredAttendees property returns an array that contains an
EmailAddressDetails object for each required attendee to the meeting. Collection
size limits:
Windows: 500 members
Classic Mac UI: 100 members
New Mac UI, web browser, Android: No limit
TypeScript
requiredAttendees: EmailAddressDetails[];
Property Value
Office.EmailAddressDetails[]
Remarks
Minimum permission level: read item
Applicable Outlook mode: Appointment Attendee
Examples
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/30-recipients-and-attendees/get-required-
attendees-appointment-attendee.yaml
const apptRequiredAttendees =
Office.context.mailbox.item.requiredAttendees;
console.log("Required attendees:");
for (let i = 0; i < apptRequiredAttendees.length; i++) {
console.log(
apptRequiredAttendees[i].displayName +
" (" +
apptRequiredAttendees[i].emailAddress +
") - response: " +
apptRequiredAttendees[i].appointmentResponse
);
}
seriesId
Gets the ID of the series that an instance belongs to.
In Outlook on the web and desktop clients, the seriesId returns the Exchange Web
Services (EWS) ID of the parent (series) item that this item belongs to. However, on
iOS and Android, the seriesId returns the REST ID of the parent item.
Note: The identifier returned by the seriesId property is the same as the Exchange
Web Services item identifier. The seriesId property is not identical to the Outlook
IDs used by the Outlook REST API. Before making REST API calls using this value, it
should be converted using Office.context.mailbox.convertToRestId . For more
details, see Use the Outlook REST APIs from an Outlook add-in.
The seriesId property returns null for items that do not have parent items such as
single appointments, series items, or meeting requests and returns undefined for any
other items that are not meeting requests.
TypeScript
seriesId: string;
Property Value
string
Remarks
[ API set: Mailbox 1.7 ]
Minimum permission level: read item
Applicable Outlook mode: Appointment Attendee
Examples
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/50-recurrence/get-series-id.yaml
const seriesId = Office.context.mailbox.item.seriesId;
if (seriesId === undefined) {
console.log("This is a message that's not a meeting request.");
} else if (seriesId === null) {
console.log("This is a single appointment, a parent series, or a
meeting request for a series or single meeting.");
} else {
console.log("This is an instance belonging to series with ID " +
seriesId);
}
start
Gets the date and time that the appointment is to begin.
The start property is a Date object expressed as a Coordinated Universal Time
(UTC) date and time value. You can use the convertToLocalClientTime method to
convert the value to the client's local date and time.
TypeScript
start: Date;
Property Value
Date
Remarks
Minimum permission level: read item
Applicable Outlook mode: Appointment Attendee
Examples
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/90-other-item-apis/get-start-read.yaml
console.log(`Appointment starts: ${Office.context.mailbox.item.start}`);
subject
Gets the description that appears in the subject field of an item.
The subject property gets or sets the entire subject of the item, as sent by the email
server.
The subject property returns a string. Use the normalizedSubject property to get
the subject minus any leading prefixes such as RE: and FW:.
TypeScript
subject: string;
Property Value
string
Remarks
Minimum permission level: read item
Applicable Outlook mode: Appointment Attendee
Examples
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/90-other-item-apis/get-subject-read.yaml
console.log(`Subject: ${Office.context.mailbox.item.subject}`);
Method Details
addHandlerAsync(eventType, handler, options, callback)
Adds an event handler for a supported event. Note: Events are only available with
task pane implementation.
For supported events, refer to the Item object model events section.
TypeScript
addHandlerAsync(eventType: Office.EventType | string, handler: any,
options: Office.AsyncContextOptions, callback?: (asyncResult:
Office.AsyncResult<void>) => void): void;
Parameters
eventType Office.EventType | string
The event that should invoke the handler.
handler any
The function to handle the event. The function must accept a single parameter,
which is an object literal. The type property on the parameter will match the
eventType parameter passed to addHandlerAsync .
options Office.AsyncContextOptions
An object literal that contains one or more of the following properties:-
asyncContext : Developers can provide any object they wish to access in the callback
function.
callback (asyncResult: Office.AsyncResult<void>) => void
Optional. When the method completes, the function passed in the callback
parameter is called with a single parameter, asyncResult , which is an
Office.AsyncResult object.
Returns
void
Remarks
[ API set: Mailbox 1.7 ]
Minimum permission level: read item
Applicable Outlook mode: Appointment Attendee
Examples
TypeScript
function myHandlerFunction(eventarg) {
if (eventarg.attachmentStatus ===
Office.MailboxEnums.AttachmentStatus.Added) {
const attachment = eventarg.attachmentDetails;
console.log("Event Fired and Attachment Added!");
getAttachmentContentAsync(attachment.id, options, callback);
}
}
Office.context.mailbox.item.addHandlerAsync(Office.EventType.AttachmentsC
hanged, myHandlerFunction, myCallback);
addHandlerAsync(eventType, handler, callback)
Adds an event handler for a supported event. Note: Events are only available with
task pane implementation.
For supported events, refer to the Item object model events section.
TypeScript
addHandlerAsync(eventType: Office.EventType | string, handler: any,
callback?: (asyncResult: Office.AsyncResult<void>) => void): void;
Parameters
eventType Office.EventType | string
The event that should invoke the handler.
handler any
The function to handle the event. The function must accept a single parameter,
which is an object literal. The type property on the parameter will match the
eventType parameter passed to addHandlerAsync .
callback (asyncResult: Office.AsyncResult<void>) => void
Optional. When the method completes, the function passed in the callback
parameter is called with a single parameter, asyncResult , which is an
Office.AsyncResult object.
Returns
void
Remarks
[ API set: Mailbox 1.7 ]
Minimum permission level: read item
Applicable Outlook mode: Appointment Attendee
displayReplyAllForm(formData)
Displays a reply form that includes either the sender and all recipients of the selected
message or the organizer and all attendees of the selected appointment.
In Outlook on the web, the reply form is displayed as a pop-out form in the 3-
column view and a pop-up form in the 2-column or 1-column view.
If any of the string parameters exceed their limits, displayReplyAllForm throws an
exception.
When attachments are specified in the formData.attachments parameter, Outlook
attempts to download all attachments and attach them to the reply form. If any
attachments fail to be added, an error is shown in the form UI. If this isn't possible,
then no error message is thrown.
Note: This method is not supported in Outlook on iOS or Android.
TypeScript
displayReplyAllForm(formData: string | ReplyFormData): void;
Parameters
formData string | Office.ReplyFormData
A string that contains text and HTML and that represents the body of the reply form.
The string is limited to 32 KB OR a ReplyFormData object that contains body or
attachment data and a callback function.
Returns
void
Remarks
Minimum permission level: read item
Applicable Outlook mode: Appointment Attendee
Examples
TypeScript
// The following code passes a string to the `displayReplyAllForm`
method.
Office.context.mailbox.item.displayReplyAllForm('hello there');
Office.context.mailbox.item.displayReplyAllForm('<b>hello there</b>');
// Reply with an empty body.
Office.context.mailbox.item.displayReplyAllForm({});
// Reply with just a body.
Office.context.mailbox.item.displayReplyAllForm(
{
'htmlBody' : 'hi'
});
// Reply with a body and a file attachment.
Office.context.mailbox.item.displayReplyAllForm(
{
'htmlBody' : 'hi',
'attachments' :
[
{
'type' : Office.MailboxEnums.AttachmentType.File,
'name' : 'squirrel.png',
'url' : 'http://i.imgur.com/sRgTlGR.jpg'
}
]
});
// Reply with a body and an item attachment.
Office.context.mailbox.item.displayReplyAllForm(
{
'htmlBody' : 'hi',
'attachments' :
[
{
'type' : 'item',
'name' : 'rand',
'itemId' : Office.context.mailbox.item.itemId
}
]
});
// Reply with a body, file attachment, item attachment, and a callback.
Office.context.mailbox.item.displayReplyAllForm(
{
'htmlBody' : 'hi',
'attachments' :
[
{
'type' : Office.MailboxEnums.AttachmentType.File,
'name' : 'squirrel.png',
'url' : 'http://i.imgur.com/sRgTlGR.jpg'
},
{
'type' : 'item',
'name' : 'rand',
'itemId' : Office.context.mailbox.item.itemId
}
],
'callback' : function(asyncResult)
{
console.log(asyncResult.value);
}
});
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/55-display-items/display-reply-forms.yaml
Office.context.mailbox.item.displayReplyAllForm("This is a reply ALL with
<b>some bold text</b>.");
displayReplyAllFormAsync(formData, options, callback)
Displays a reply form that includes either the sender and all recipients of the selected
message or the organizer and all attendees of the selected appointment.
In Outlook on the web, the reply form is displayed as a pop-out form in the 3-
column view and a pop-up form in the 2-column or 1-column view.
If any of the string parameters exceed their limits, displayReplyAllFormAsync throws
an exception.
When attachments are specified in the formData.attachments parameter, Outlook
attempts to download all attachments and attach them to the reply form. If any
attachments fail to be added, an error is shown in the form UI. If this isn't possible,
then no error message is thrown.
Note: This method is not supported in Outlook on iOS or Android.
TypeScript
displayReplyAllFormAsync(formData: string | ReplyFormData, options:
Office.AsyncContextOptions, callback?: (asyncResult:
Office.AsyncResult<void>) => void): void;
Parameters
formData string | Office.ReplyFormData
A string that contains text and HTML and that represents the body of the reply form.
The string is limited to 32 KB OR a ReplyFormData object that contains body or
attachment data and a callback function.
options Office.AsyncContextOptions
An object literal that contains one or more of the following properties:-
asyncContext : Developers can provide any object they wish to access in the callback
function.
callback (asyncResult: Office.AsyncResult<void>) => void
Optional. When the method completes, the function passed in the callback
parameter is called with a single parameter, asyncResult , which is an
Office.AsyncResult object.
Returns
void
Remarks
[ API set: Mailbox 1.9 ]
Minimum permission level: read item
Applicable Outlook mode: Appointment Attendee
Examples
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/55-display-items/display-reply-forms.yaml
Office.context.mailbox.item.displayReplyAllFormAsync("This is a reply ALL
with <b>some bold text</b>.", function(
asyncResult
) {
console.log(JSON.stringify(asyncResult));
});
displayReplyAllFormAsync(formData, callback)
Displays a reply form that includes either the sender and all recipients of the selected
message or the organizer and all attendees of the selected appointment.
In Outlook on the web, the reply form is displayed as a pop-out form in the 3-
column view and a pop-up form in the 2-column or 1-column view.
If any of the string parameters exceed their limits, displayReplyAllFormAsync throws
an exception.
When attachments are specified in the formData.attachments parameter, Outlook
attempts to download all attachments and attach them to the reply form. If any
attachments fail to be added, an error is shown in the form UI. If this isn't possible,
then no error message is thrown.
Note: This method is not supported in Outlook on iOS or Android.
TypeScript
displayReplyAllFormAsync(formData: string | ReplyFormData, callback?:
(asyncResult: Office.AsyncResult<void>) => void): void;
Parameters
formData string | Office.ReplyFormData
A string that contains text and HTML and that represents the body of the reply form.
The string is limited to 32 KB OR a ReplyFormData object that contains body or
attachment data and a callback function.
callback (asyncResult: Office.AsyncResult<void>) => void
Optional. When the method completes, the function passed in the callback
parameter is called with a single parameter, asyncResult , which is an
Office.AsyncResult object.
Returns
void
Remarks
[ API set: Mailbox 1.9 ]
Minimum permission level: read item
Applicable Outlook mode: Appointment Attendee
displayReplyForm(formData)
Displays a reply form that includes only the sender of the selected message or the
organizer of the selected appointment.
In Outlook on the web, the reply form is displayed as a pop-out form in the 3-
column view and a pop-up form in the 2-column or 1-column view.
If any of the string parameters exceed their limits, displayReplyForm throws an
exception.
When attachments are specified in the formData.attachments parameter, Outlook
attempts to download all attachments and attach them to the reply form. If any
attachments fail to be added, an error is shown in the form UI. If this isn't possible,
then no error message is thrown.
Note: This method is not supported in Outlook on iOS or Android.
TypeScript
displayReplyForm(formData: string | ReplyFormData): void;
Parameters
formData string | Office.ReplyFormData
A string that contains text and HTML and that represents the body of the reply form.
The string is limited to 32 KB OR a ReplyFormData object that contains body or
attachment data and a callback function.
Returns
void
Remarks
Minimum permission level: read item
Applicable Outlook mode: Appointment Attendee
Examples
TypeScript
// The following code passes a string to the `displayReplyForm` method.
Office.context.mailbox.item.displayReplyForm('hello there');
Office.context.mailbox.item.displayReplyForm('<b>hello there</b>');
// Reply with an empty body.
Office.context.mailbox.item.displayReplyForm({});
// Reply with just a body.
Office.context.mailbox.item.displayReplyForm(
{
'htmlBody' : 'hi'
});
// Reply with a body and a file attachment.
Office.context.mailbox.item.displayReplyForm(
{
'htmlBody' : 'hi',
'attachments' :
[
{
'type' : Office.MailboxEnums.AttachmentType.File,
'name' : 'squirrel.png',
'url' : 'http://i.imgur.com/sRgTlGR.jpg'
}
]
});
// Reply with a body and an item attachment.
Office.context.mailbox.item.displayReplyForm(
{
'htmlBody' : 'hi',
'attachments' :
[
{
'type' : 'item',
'name' : 'rand',
'itemId' : Office.context.mailbox.item.itemId
}
]
});
// Reply with a body, file attachment, item attachment, and a callback.
Office.context.mailbox.item.displayReplyForm(
{
'htmlBody' : 'hi',
'attachments' :
[
{
'type' : Office.MailboxEnums.AttachmentType.File,
'name' : 'squirrel.png',
'url' : 'http://i.imgur.com/sRgTlGR.jpg'
},
{
'type' : 'item',
'name' : 'rand',
'itemId' : Office.context.mailbox.item.itemId
}
],
'callback' : function(asyncResult)
{
console.log(asyncResult.value);
}
});
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/55-display-items/display-reply-forms.yaml
Office.context.mailbox.item.displayReplyForm("This is a reply with
<i>some text in italics</i>.");
...
Office.context.mailbox.item.displayReplyForm({
htmlBody: "This is a reply with a couple of attachments - an inline
image and an item<br><img src='cid:dog.jpg'>",
attachments: [
{ type: "file", url: "http://i.imgur.com/9S36xvA.jpg", name:
"dog.jpg", isInline: true },
{ type: "item", itemId: Office.context.mailbox.item.itemId, name:
"test_email.msg" }
],
options: { asyncContext: null },
callback: function(result) {
if (result.status !== Office.AsyncResultStatus.Succeeded) {
console.error(`Action failed with message
${result.error.message}`);
}
}
});
displayReplyFormAsync(formData, options, callback)
Displays a reply form that includes only the sender of the selected message or the
organizer of the selected appointment.
In Outlook on the web, the reply form is displayed as a pop-out form in the 3-
column view and a pop-up form in the 2-column or 1-column view.
If any of the string parameters exceed their limits, displayReplyFormAsync throws an
exception.
When attachments are specified in the formData.attachments parameter, Outlook
attempts to download all attachments and attach them to the reply form. If any
attachments fail to be added, an error is shown in the form UI. If this isn't possible,
then no error message is thrown.
Note: This method is not supported in Outlook on iOS or Android.
TypeScript
displayReplyFormAsync(formData: string | ReplyFormData, options:
Office.AsyncContextOptions, callback?: (asyncResult:
Office.AsyncResult<void>) => void): void;
Parameters
formData string | Office.ReplyFormData
A string that contains text and HTML and that represents the body of the reply form.
The string is limited to 32 KB OR a ReplyFormData object that contains body or
attachment data and a callback function.
options Office.AsyncContextOptions
An object literal that contains one or more of the following properties:-
asyncContext : Developers can provide any object they wish to access in the callback
function.
callback (asyncResult: Office.AsyncResult<void>) => void
Optional. When the method completes, the function passed in the callback
parameter is called with a single parameter, asyncResult , which is an
Office.AsyncResult object.
Returns
void
Remarks
[ API set: Mailbox 1.9 ]
Minimum permission level: read item
Applicable Outlook mode: Appointment Attendee
Examples
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/55-display-items/display-reply-forms.yaml
Office.context.mailbox.item.displayReplyFormAsync("This is a reply with
<i>some text in italics</i>.", function(
asyncResult
) {
console.log(JSON.stringify(asyncResult));
});
...
// The async version is only available starting with requirement set 1.9,
// and provides a callback when the new appointment form has been
created.
Office.context.mailbox.item.displayReplyFormAsync(
{
htmlBody: "This is a reply with a couple of attachments - an inline
image and an item<br><img src='cid:dog.jpg'>",
attachments: [
{ type: "file", url: "http://i.imgur.com/9S36xvA.jpg", name:
"dog.jpg", isInline: true },
{ type: "item", itemId: Office.context.mailbox.item.itemId, name:
"test_email.msg" }
]
},
function(asyncResult) {
console.log(JSON.stringify(asyncResult));
}
);
displayReplyFormAsync(formData, callback)
Displays a reply form that includes only the sender of the selected message or the
organizer of the selected appointment.
In Outlook on the web, the reply form is displayed as a pop-out form in the 3-
column view and a pop-up form in the 2-column or 1-column view.
If any of the string parameters exceed their limits, displayReplyFormAsync throws an
exception.
When attachments are specified in the formData.attachments parameter, Outlook
attempts to download all attachments and attach them to the reply form. If any
attachments fail to be added, an error is shown in the form UI. If this isn't possible,
then no error message is thrown.
Note: This method is not supported in Outlook on iOS or Android.
TypeScript
displayReplyFormAsync(formData: string | ReplyFormData, callback?:
(asyncResult: Office.AsyncResult<void>) => void): void;
Parameters
formData string | Office.ReplyFormData
A string that contains text and HTML and that represents the body of the reply form.
The string is limited to 32 KB OR a ReplyFormData object that contains body or
attachment data and a callback function.
callback (asyncResult: Office.AsyncResult<void>) => void
Optional. When the method completes, the function passed in the callback
parameter is called with a single parameter, asyncResult , which is an
Office.AsyncResult object.
Returns
void
Remarks
[ API set: Mailbox 1.9 ]
Minimum permission level: read item
Applicable Outlook mode: Appointment Attendee
getAttachmentContentAsync(attachmentId, options,
callback)
Gets an attachment from a message or appointment and returns it as an
AttachmentContent object.
The getAttachmentContentAsync method gets the attachment with the specified
identifier from the item. As a best practice, you should get the attachment's identifier
from an item.attachments call, then in the same session, use that identifier to retrieve
the attachment. In Outlook on the web and mobile devices, the attachment identifier
is valid only within the same session. A session is over when the user closes the app,
or if the user starts composing an inline form then subsequently pops out the form
to continue in a separate window.
TypeScript
getAttachmentContentAsync(attachmentId: string, options:
Office.AsyncContextOptions, callback?: (asyncResult:
Office.AsyncResult<AttachmentContent>) => void): void;
Parameters
attachmentId string
The identifier of the attachment you want to get.
options Office.AsyncContextOptions
An object literal that contains one or more of the following properties:-
asyncContext : Developers can provide any object they wish to access in the callback
function.
callback (asyncResult: Office.AsyncResult<Office.AttachmentContent>) => void
Optional. When the method completes, the function passed in the callback
parameter is called with a single parameter, asyncResult , which is an
Office.AsyncResult object. If the call fails, the asyncResult.error property will
contain an error code with the reason for the failure.
Returns
void
Remarks
[ API set: Mailbox 1.8 ]
Minimum permission level: read item
Applicable Outlook mode: Appointment Attendee
Errors:
AttachmentTypeNotSupported : The attachment type isn't supported.
Unsupported types include embedded images in Rich Text Format, or item
attachment types other than email or calendar items (such as a contact or task
item).
InvalidAttachmentId : The attachment identifier does not exist.
Examples
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/40-attachments/get-attachment-content.yaml
// Gets the attachments of the current message or appointment in read
mode.
// The item.attachments call can only be used in read mode.
const attachments = item.attachments;
if (attachments.length <= 0) {
console.log("Mail item has no attachments.");
return;
}
for (let i = 0; i < attachments.length; i++) {
// Log the attachment type and its contents to the console.
item.getAttachmentContentAsync(attachments[i].id,
handleAttachmentsCallback);
}
getAttachmentContentAsync(attachmentId, callback)
Gets an attachment from a message or appointment and returns it as an
AttachmentContent object.
The getAttachmentContentAsync method gets the attachment with the specified
identifier from the item. As a best practice, you should get the attachment's identifier
from an item.attachments call, then in the same session, use that identifier to retrieve
the attachment. In Outlook on the web and mobile devices, the attachment identifier
is valid only within the same session. A session is over when the user closes the app,
or if the user starts composing an inline form then subsequently pops out the form
to continue in a separate window.
TypeScript
getAttachmentContentAsync(attachmentId: string, callback?: (asyncResult:
Office.AsyncResult<AttachmentContent>) => void): void;
Parameters
attachmentId string
The identifier of the attachment you want to get.
callback (asyncResult: Office.AsyncResult<Office.AttachmentContent>) => void
Optional. When the method completes, the function passed in the callback
parameter is called with a single parameter, asyncResult , which is an
Office.AsyncResult object. If the call fails, the asyncResult.error property will
contain an error code with the reason for the failure.
Returns
void
Remarks
[ API set: Mailbox 1.8 ]
Minimum permission level: read item
Applicable Outlook mode: Appointment Attendee
Errors:
AttachmentTypeNotSupported : The attachment type isn't supported.
Unsupported types include embedded images in Rich Text Format, or item
attachment types other than email or calendar items (such as a contact or task
item).
InvalidAttachmentId : The attachment identifier does not exist.
getEntities()
Gets the entities found in the selected item's body.
Note: This method is not supported in Outlook on iOS or Android.
TypeScript
getEntities(): Entities;
Returns
Office.Entities
Remarks
Minimum permission level: read item
Applicable Outlook mode: Appointment Attendee
Examples
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/75-entities-and-regex-matches/basic-
entities.yaml
const entities = Office.context.mailbox.item.getEntities();
let entityTypesFound = 0;
if (entities.addresses.length > 0) {
console.warn("physical addresses: ");
console.log(entities.addresses);
entityTypesFound++;
}
if (entities.contacts.length > 0) {
console.warn("contacts: ");
entities.contacts.forEach(function (contact) {
console.log(contact.personName); })
entityTypesFound++;
}
if (entities.emailAddresses.length > 0) {
console.warn("email addresses: ");
console.log(entities.emailAddresses);
entityTypesFound++;
}
if (entities.meetingSuggestions.length > 0) {
console.warn("meetings suggestions: ");
entities.meetingSuggestions.forEach(function (meetingSuggestion) {
console.log(meetingSuggestion.meetingString); })
entityTypesFound++;
}
if (entities.phoneNumbers.length > 0) {
console.warn("phone numbers: ");
entities.phoneNumbers.forEach(function (phoneNumber) {
console.log(phoneNumber.originalPhoneString); })
entityTypesFound++;
}
if (entities.taskSuggestions.length > 0) {
console.warn("task suggestions: ");
entities.taskSuggestions.forEach(function (taskSuggestion) {
console.log(taskSuggestion.taskString); })
entityTypesFound++;
}
if (entities.urls.length > 0) {
console.warn("URLs: ");
console.log(entities.urls);
entityTypesFound++;
}
if (entityTypesFound == 0)
{
console.log("No entities found on this item.");
}
getEntitiesByType(entityType)
Gets an array of all the entities of the specified entity type found in the selected
item's body.
Note: This method is not supported in Outlook on iOS or Android.
TypeScript
getEntitiesByType(entityType: MailboxEnums.EntityType | string): (string
| Contact | MeetingSuggestion | PhoneNumber | TaskSuggestion)[];
Parameters
entityType Office.MailboxEnums.EntityType | string
One of the EntityType enumeration values.
While the minimum permission level to use this method is restricted, some entity
types require read item to access, as specified in the following table.
Value of entityType Type of objects in returned array Required Permission Level
Address String Restricted
Contact Contact ReadItem
EmailAddress String ReadItem
MeetingSuggestion MeetingSuggestion ReadItem
PhoneNumber PhoneNumber Restricted
TaskSuggestion TaskSuggestion ReadItem
URL String Restricted
Returns
(string | Office.Contact | Office.MeetingSuggestion | Office.PhoneNumber |
Office.TaskSuggestion)[]
If the value passed in entityType is not a valid member of the EntityType
enumeration, the method returns null. If no entities of the specified type are present
in the item's body, the method returns an empty array. Otherwise, the type of the
objects in the returned array depends on the type of entity requested in the
entityType parameter.
Remarks
Minimum permission level: restricted
Applicable Outlook mode: Appointment Attendee
Examples
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/75-entities-and-regex-matches/basic-
entities.yaml
console.log(Office.context.mailbox.item.getEntitiesByType(Office.MailboxE
nums.EntityType.Address));
getFilteredEntitiesByName(name)
Returns well-known entities in the selected item that pass the named filter defined in
an XML manifest file.
Note: This method is used with the activation rules feature for Outlook add-ins,
which isn't supported by the Teams manifest for Office Add-ins (preview).
The getFilteredEntitiesByName method returns the entities that match the regular
expression defined in the ItemHasKnownEntity rule element in the manifest XML file
with the specified FilterName element value.
Note: This method is not supported in Outlook on iOS or Android.
TypeScript
getFilteredEntitiesByName(name: string): (string | Contact |
MeetingSuggestion | PhoneNumber | TaskSuggestion)[];
Parameters
name string
The name of the ItemHasKnownEntity rule element that defines the filter to match.
Returns
(string | Office.Contact | Office.MeetingSuggestion | Office.PhoneNumber |
Office.TaskSuggestion)[]
If there is no ItemHasKnownEntity element in the manifest with a FilterName element
value that matches the name parameter, the method returns null . If the name
parameter matches an ItemHasKnownEntity element in the manifest, but there are no
entities in the current item that match, the method return an empty array.
Remarks
Minimum permission level: read item
Applicable Outlook mode: Appointment Attendee
Examples
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/75-entities-and-regex-
matches/contextual.yaml
// This API would only work when you click on highlighted physical
address that has the word "Way" in it.
console.log(Office.context.mailbox.item.getFilteredEntitiesByName("sample
FilterName"));
getInitializationContextAsync(options, callback)
Gets initialization data passed when the add-in is activated by an actionable
message.
TypeScript
getInitializationContextAsync(options: Office.AsyncContextOptions,
callback: (asyncResult: Office.AsyncResult<string>) => void): void;
Parameters
options Office.AsyncContextOptions
An object literal that contains one or more of the following properties:-
asyncContext : Developers can provide any object they wish to access in the callback
function.
callback (asyncResult: Office.AsyncResult<string>) => void
When the method completes, the function passed in the callback parameter is
called with a single parameter of type Office.AsyncResult . On success, the
initialization context data is provided as a string (or an empty string if there's no
initialization context) in the asyncResult.value property.
Returns
void
Remarks
[ API set: Mailbox 1.8 ]
Minimum permission level: read item
Applicable Outlook mode: Appointment Attendee
Examples
TypeScript
// Get the initialization context (if present).
Office.context.mailbox.item.getInitializationContextAsync((asyncResult)
=> {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
if (asyncResult.value.length > 0) {
// The value is a string, parse to an object.
const context = JSON.parse(asyncResult.value);
// Do something with context.
} else {
// Empty context, treat as no context.
}
} else {
// Handle the error.
}
});
getInitializationContextAsync(callback)
Gets initialization data passed when the add-in is activated by an actionable
message.
TypeScript
getInitializationContextAsync(callback: (asyncResult:
Office.AsyncResult<string>) => void): void;
Parameters
callback (asyncResult: Office.AsyncResult<string>) => void
When the method completes, the function passed in the callback parameter is
called with a single parameter of type Office.AsyncResult . On success, the
initialization context data is provided as a string (or an empty string if there's no
initialization context) in the asyncResult.value property.
Returns
void
Remarks
[ API set: Mailbox 1.8 ]
Minimum permission level: read item
Applicable Outlook mode: Appointment Attendee
getRegExMatches()
Returns string values in the selected item that match the regular expressions defined
in an XML manifest file.
Note: This method is used with the activation rules feature for Outlook add-ins,
which isn't supported by the Teams manifest for Office Add-ins (preview).
The getRegExMatches method returns the strings that match the regular expression
defined in each ItemHasRegularExpressionMatch or ItemHasKnownEntity rule element
in the manifest XML file. For an ItemHasRegularExpressionMatch rule, a matching
string has to occur in the property of the item that is specified by that rule. The
PropertyName simple type defines the supported properties.
If you specify an ItemHasRegularExpressionMatch rule on the body property of an
item, the regular expression should further filter the body and should not attempt to
return the entire body of the item. Using a regular expression such as .* to obtain the
entire body of an item does not always return the expected results. Instead, use the
Body.getAsync method to retrieve the entire body.
Note: This method is not supported in Outlook on iOS or Android.
TypeScript
getRegExMatches(): any;
Returns
any
An object that contains arrays of strings that match the regular expressions defined
in the manifest XML file. The name of each array is equal to the corresponding value
of the RegExName attribute of the matching ItemHasRegularExpressionMatch rule or
the FilterName attribute of the matching ItemHasKnownEntity rule.
Remarks
Minimum permission level: read item
Applicable Outlook mode: Appointment Attendee
Examples
TypeScript
// Consider an add-in manifest has the following `Rule` element:
//<Rule xsi:type="RuleCollection" Mode="And">
// <Rule xsi:type="ItemIs" FormType="Read" ItemType="Message" />
// <Rule xsi:type="RuleCollection" Mode="Or">
// <Rule xsi:type="ItemHasRegularExpressionMatch" RegExName="fruits"
RegExValue="apple|banana|coconut" PropertyName="BodyAsPlaintext"
IgnoreCase="true" />
// <Rule xsi:type="ItemHasRegularExpressionMatch" RegExName="veggies"
RegExValue="tomato|onion|spinach|broccoli" PropertyName="BodyAsPlaintext"
IgnoreCase="true" />
// </Rule>
//</Rule>
// The object returned from `getRegExMatches` would have two properties:
`fruits` and `veggies`.
//{
//'fruits': ['apple','banana','Banana','coconut'],
//'veggies': ['tomato','onion','spinach','broccoli']
//}
// The following example shows how to access the array of
// matches for the regular expression rule elements `fruits`
// and `veggies`, which are specified in the manifest.
const allMatches = Office.context.mailbox.item.getRegExMatches();
const fruits = allMatches.fruits;
const veggies = allMatches.veggies;
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/75-entities-and-regex-
matches/contextual.yaml
// This API would only work when you click on highlighted word
"ScriptLab".
console.log(Office.context.mailbox.item.getRegExMatches());
getRegExMatchesByName(name)
Returns string values in the selected item that match the named regular expression
defined in an XML manifest file.
Note: This method is used with the activation rules feature for Outlook add-ins,
which isn't supported by the Teams manifest for Office Add-ins (preview).
The getRegExMatchesByName method returns the strings that match the regular
expression defined in the ItemHasRegularExpressionMatch rule element in the
manifest XML file with the specified RegExName element value.
If you specify an ItemHasRegularExpressionMatch rule on the body property of an
item, the regular expression should further filter the body and should not attempt to
return the entire body of the item. Using a regular expression such as .* to obtain the
entire body of an item does not always return the expected results.
Note: This method is not supported in Outlook on iOS or Android.
TypeScript
getRegExMatchesByName(name: string): string[];
Parameters
name string
The name of the ItemHasRegularExpressionMatch rule element that defines the filter
to match.
Returns
string[]
An array that contains the strings that match the regular expression defined in the
manifest XML file.
Remarks
Minimum permission level: read item
Applicable Outlook mode: Appointment Attendee
Examples
TypeScript
// Consider an add-in manifest has the following `Rule` element:
//<Rule xsi:type="RuleCollection" Mode="And">
// <Rule xsi:type="ItemIs" FormType="Read" ItemType="Message" />
// <Rule xsi:type="RuleCollection" Mode="Or">
// <Rule xsi:type="ItemHasRegularExpressionMatch" RegExName="fruits"
RegExValue="apple|banana|coconut" PropertyName="BodyAsPlaintext"
IgnoreCase="true" />
// <Rule xsi:type="ItemHasRegularExpressionMatch" RegExName="veggies"
RegExValue="tomato|onion|spinach|broccoli" PropertyName="BodyAsPlaintext"
IgnoreCase="true" />
// </Rule>
//</Rule>
// The object returned from `getRegExMatches` would have two properties:
`fruits` and `veggies`.
//{
//'fruits': ['apple','banana','Banana','coconut'],
//'veggies': ['tomato','onion','spinach','broccoli']
//}
const fruits =
Office.context.mailbox.item.getRegExMatchesByName("fruits");
const veggies =
Office.context.mailbox.item.getRegExMatchesByName("veggies");
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/75-entities-and-regex-
matches/contextual.yaml
// This API would only work when you click on highlighted word
"ScriptLab".
console.log(Office.context.mailbox.item.getRegExMatchesByName("sampleRege
xName"));
getSelectedEntities()
Gets the entities found in a highlighted match a user has selected. Highlighted
matches apply to contextual add-ins.
Note: This method is used with the activation rules feature for Outlook add-ins,
which isn't supported by the Teams manifest for Office Add-ins (preview).
Note: This method is not supported in Outlook on iOS or Android.
TypeScript
getSelectedEntities(): Entities;
Returns
Office.Entities
Remarks
[ API set: Mailbox 1.6 ]
Minimum permission level: read item
Applicable Outlook mode: Appointment Attendee
Examples
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/75-entities-and-regex-matches/selected.yaml
const entities = Office.context.mailbox.item.getSelectedEntities();
let entityTypesFound = 0;
if (entities.addresses.length > 0) {
console.warn("physical addresses: ");
console.log(entities.addresses);
entityTypesFound++;
}
if (entities.contacts.length > 0) {
console.warn("contacts: ");
entities.contacts.forEach(function (contact) {
console.log(contact.personName); })
entityTypesFound++;
}
if (entities.emailAddresses.length > 0) {
console.warn("email addresses: ");
console.log(entities.emailAddresses);
entityTypesFound++;
}
if (entities.meetingSuggestions.length > 0) {
console.warn("meetings suggestions: ");
entities.meetingSuggestions.forEach(function (meetingSuggestion) {
console.log(meetingSuggestion.meetingString); })
entityTypesFound++;
}
if (entities.phoneNumbers.length > 0) {
console.warn("phone numbers: ");
entities.phoneNumbers.forEach(function (phoneNumber) {
console.log(phoneNumber.originalPhoneString); })
entityTypesFound++;
}
if (entities.taskSuggestions.length > 0) {
console.warn("task suggestions: ");
entities.taskSuggestions.forEach(function (taskSuggestion) {
console.log(taskSuggestion.taskString); })
entityTypesFound++;
}
if (entities.urls.length > 0) {
console.warn("URLs: ");
console.log(entities.urls);
entityTypesFound++;
}
if (entityTypesFound == 0)
{
console.error("Open add-in by clicking on a highlighted entity, for
this API to return something useful.");
}
getSelectedRegExMatches()
Returns string values in a highlighted match that match the regular expressions
defined in an XML manifest file. Highlighted matches apply to contextual add-ins.
Note: This method is used with the activation rules feature for Outlook add-ins,
which isn't supported by the Teams manifest for Office Add-ins (preview).
The getSelectedRegExMatches method returns the strings that match the regular
expression defined in each ItemHasRegularExpressionMatch or ItemHasKnownEntity
rule element in the manifest XML file. For an ItemHasRegularExpressionMatch rule, a
matching string has to occur in the property of the item that is specified by that rule.
The PropertyName simple type defines the supported properties.
If you specify an ItemHasRegularExpressionMatch rule on the body property of an
item, the regular expression should further filter the body and should not attempt to
return the entire body of the item. Using a regular expression such as .* to obtain the
entire body of an item does not always return the expected results. Instead, use the
Body.getAsync method to retrieve the entire body.
Note: This method is not supported in Outlook on iOS or Android.
TypeScript
getSelectedRegExMatches(): any;
Returns
any
An object that contains arrays of strings that match the regular expressions defined
in the manifest XML file. The name of each array is equal to the corresponding value
of the RegExName attribute of the matching ItemHasRegularExpressionMatch rule or
the FilterName attribute of the matching ItemHasKnownEntity rule.
Remarks
[ API set: Mailbox 1.6 ]
Minimum permission level: read item
Applicable Outlook mode: Appointment Attendee
Examples
TypeScript
// Consider an add-in manifest has the following `Rule` element:
//<Rule xsi:type="RuleCollection" Mode="And">
// <Rule xsi:type="ItemIs" FormType="Read" ItemType="Message" />
// <Rule xsi:type="RuleCollection" Mode="Or">
// <Rule xsi:type="ItemHasRegularExpressionMatch" RegExName="fruits"
RegExValue="apple|banana|coconut" PropertyName="BodyAsPlaintext"
IgnoreCase="true" />
// <Rule xsi:type="ItemHasRegularExpressionMatch" RegExName="veggies"
RegExValue="tomato|onion|spinach|broccoli" PropertyName="BodyAsPlaintext"
IgnoreCase="true" />
// </Rule>
//</Rule>
// The object returned from `getRegExMatches` would have two properties:
`fruits` and `veggies`.
//{
//'fruits': ['apple','banana','Banana','coconut'],
//'veggies': ['tomato','onion','spinach','broccoli']
//}
// The following example shows how to access the array of matches for the
// regular expression rule elements `fruits` and `veggies`, which are
// specified in the manifest.
const selectedMatches =
Office.context.mailbox.item.getSelectedRegExMatches();
const fruits = selectedMatches.fruits;
const veggies = selectedMatches.veggies;
TypeScript
// Link to full sample:
https://raw.githubusercontent.com/OfficeDev/office-js-
snippets/prod/samples/outlook/75-entities-and-regex-matches/selected.yaml
const matches = Office.context.mailbox.item.getSelectedRegExMatches();
if (matches) {
console.log(matches);
}
else {
console.error("Open add-in by clicking on a highlighted regex match,
for this API to return something useful.");
}
getSharedPropertiesAsync(options, callback)
Gets the properties of an appointment or message in a shared folder or shared
mailbox.
For more information around using this API, see Enable shared folders and shared
mailbox scenarios in an Outlook add-in.
TypeScript
getSharedPropertiesAsync(options: Office.AsyncContextOptions