Google Apps Script

Enum ParagraphHeading

An enumeration of the standard paragraph headings.

Use the ParagraphHeading enumeration to configure the heading style for ParagraphElement.

var body = DocumentApp.getActiveDocument().getBody();

 // Append a paragraph, with heading 1.
 var par1 = body.appendParagraph("Title");

 // Append a paragraph, with heading 2.
 var par2 = body.appendParagraph("SubTitle");

 // Append a paragraph, with normal heading.
 var par3 = body.appendParagraph("Text");


NORMALEnumThe heading option for normal text.
HEADING1EnumThe highest heading option.
HEADING2EnumThe second heading option.
HEADING3EnumThe third heading option
HEADING4EnumThe fourth heading option.
HEADING5EnumThe fifth heading option.
HEADING6EnumThe lowest heading option.
TITLEEnumThe title heading option.
SUBTITLEEnumThe subtitle heading option.

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.