Enum TabType

Tab Type

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 Tab Type 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 Document Tab .
Create a Mobile Website
View Site in Mobile | Classic
Share by: