Using script to change the look of built-in paragraph styles in Google docs

by Ingeborg   Last Updated January 21, 2018 07:03 AM

I need to edit the look of the styles in Google docs. I'm using script to insert text into a blank document. Before I insert the text I define the look of new styles like this:

var vedlegget = {};
vedlegget[DocumentApp.Attribute.FONT_SIZE] = 10;
vedlegget[DocumentApp.Attribute.BOLD] = false;
vedlegget[DocumentApp.Attribute.ITALIC] = true;
vedlegget[DocumentApp.Attribute.SPACING_AFTER] =7;
vedlegget[DocumentApp.Attribute.FOREGROUND_COLOR] = '#007cb0';

But I also need to use the built-in-styles like Normal and Headings. I need to make a Table of Contents etc.

How do I define the look of the style HEADING1?

I insert the Heading 1 text like shown here:

But I cannot find any way of editing the style.

Related Questions

Google Docs date capitalisation script

Updated December 23, 2017 17:03 PM

Alternative to "UrlFetchApp.fetch" at Google Docs?

Updated November 16, 2017 00:03 AM

Update footer date, don't clear the contents

Updated January 11, 2018 18:03 PM

Google Script - convert link to image in doc

Updated March 13, 2018 03:03 AM

Unable to submit form opened by Google Sheets

Updated December 15, 2017 01:03 AM