Office.TaskPane interface
Provides methods to manage the task pane of an add-in.
Remarks
Requirement set: TaskPaneApi 1.1
Used by
Examples
// Adjust the width of the task pane.
const width = 500;
Office.extensionLifeCycle.taskpane.setWidth(width);
Methods
| set |
Sets the width of the task pane of an add-in in pixels. |
Method Details
setWidth(width)
Sets the width of the task pane of an add-in in pixels.
setWidth(width: number): void;
Parameters
- width
-
number
The width of a task pane in pixels.
Returns
void
Remarks
Requirement set: TaskPaneApi 1.1
Important: The minimum and maximum width constraints vary by platform.
Web (Excel): Between 350 and 500 px (inclusive)
Web (Word): Between 330 and 500 px (inclusive)
Windows: Between 86 px and 50% of the client window
Mac: Between 270 px and 50% of the client window
The default width of the task pane of an add-in varies depending on the platform.
Web (Excel): 350 px
Web (Word): 330 px
Windows: 320 px
Mac: 270 px
If you pass a width beyond the minimum and maximum constraints, the task pane isn't resized and no error is shown.
The setWidth method isn't supported in PowerPoint on the web.