This topic describes the methods, property, and events of the Panes object.
Panes
The Panes object.
Syntax
expression.Panesexpression: the document type application object.
Example
//@file=base.docx async function example() { await instance.ready(); const app = instance.Application; // The Panes object. const panes = await app.Panes; }
Methods
Panes.Add()
Adds a pane.
Syntax
expression.Add({ Caption, Visible })expression: the instantiated
Panesobject.Parameters
Property
Type
Required
Description
Caption
String
Yes
The caption of the pane.
Visible
Boolean
No
Specifies whether to show the pane.
Return values
Returns the corresponding
Panesobject.Example
//@file=base.docx async function example() { await instance.ready(); const app = instance.Application; // The Panes object. const panes = await app.Panes; // Add a pane. const pane = await panes.Add({ Caption: 'Pane', Visible: true, }); }
Panes.Delete()
Deletes a pane.
Syntax
expression.Delete()expression: the instantiated
Panesobject.Example
//@file=base.docx async function example() { await instance.ready(); const app = instance.Application; // The Panes object. const panes = await app.Panes; // Add a pane. const pane = await panes.Add({ Caption: 'Pane', Visible: true, }); // Delete the pane after 3000 ms. setTimeout(async () => { await pane.Delete(); }, 3000); }
Property
Panes.Visible
Hides or shows the pane.
Syntax
expression.Visibleexpression: the instantiated
Panesobject.Example
//@file=base.docx async function example() { await instance.ready(); const app = instance.Application; // The Panes object. const panes = await app.Panes; // Hide the pane. const pane = await panes.Add({ Caption: 'Pane', Visible: false, }); // Show the pane after 3000 ms. setTimeout(() => { pane.Visible = true; }, 3000); }
Events
Panes.OnClose
Listens to the event that occurs when the pane is closed.
Syntax
expression.OnClose = Functionexpression: the instantiated
Panesobject.Example
//@file=base.docx async function example() { await instance.ready(); const app = instance.Application; // The Panes object. const panes = await app.Panes; // Add a pane. const pane = await panes.Add({ Caption: 'Pane', Visible: true, }); // Listen to the event that occurs when the pane is closed. pane.OnClose = () => { console.log ('Pane closed'); } }
Panes.OnShow
Listens to the event that occurs when the pane is shown.
Syntax
expression. OnShow = Functionexpression: the instantiated
Panesobject.Example
//@file=base.docx async function example() { await instance.ready(); const app = instance.Application; // The Panes object. const panes = await app.Panes; // Add a pane. const pane = await panes.Add({ Caption: 'Pane', Visible: true, }); // Listen to the event that occurs when the pane is shown. pane.OnShow = (e) => { console.log ('Pane shown'); } }