Enum TabType
TabType
An enumeration of all the tab types.
To call an enum, you call its parent class, name, and property. For example,
DocumentApp.TabType.TAB
.
Use the TabType
enumeration to check the type of a given element, for instance:
const tab = DocumentApp.getActiveDocument().getActiveTab();
// Use getType() to determine the tab's type before casting.
if (tab.getType() === DocumentApp.TabType.DOCUMENT_TAB) {
// It's a document tab, write some text to it.
tab.asDocumentTab().setText('Hello World!');
} else {
// There are currently no types other than DOCUMENT_TAB.
}
Properties
Property | Type | Description |
DOCUMENT_TAB | Enum | The type corresponding to DocumentTab . |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-11-26 UTC.
[null,null,["Last updated 2024-11-26 UTC."],[[["`TabType` is an enumeration used to identify different tab types within a Google Doc."],["Currently, `DOCUMENT_TAB` is the only available tab type, representing a document tab that can be interacted with using the `DocumentTab` class."],["You can determine the type of a tab using `getType()` and then perform actions based on its specific type, such as adding text to a `DOCUMENT_TAB`."]]],[]]