Ivan Pereverzev
Ivan Pereverzev

Reputation: 11

How to change header margins through Google Apps Script?

Google Docs released new options for controlling header margins Nov, 2018. https://gsuiteupdates.googleblog.com/2018/10/vertical-ruler-table-header-size-google-docs.html

How I can change these options through Google Apps Script? Is it possible? I can't find any information about header margins on the official documentation https://developers.google.com/apps-script/reference/document/header-section and on any other posts related to GAS.

I will be glad of any information on this issue. Thanks.

Upvotes: 1

Views: 1650

Answers (2)

Wicket
Wicket

Reputation: 38160

Not all Google Docs features have a Google Apps Script method to create/insert/modify them but it is also true that some methods were spotted before they were officially announced like the partial text formatting for Google Sheets cell values, I think because autocomplete.

Using autocomplete

The script editor provides a "content assist" feature, more commonly called "autocomplete," which reveals the global objects as well as methods and enums that are valid in the script's current context. To show autocomplete suggestions, select the menu item Edit > Content assist or press Ctrl + Space. Autocomplete suggestions also appear automatically whenever you type a period after a global object, enum, or method call that returns an Apps Script class. For example:

  • If you click on a blank line in the script editor and activate autocomplete, you will see a list of the global objects.
  • If you type the full name of a global object or select one from autocomplete, then type . (a period), you will see all methods and enums for that class.
  • If you type a few characters and activate autocomplete, you will see all valid suggestions that begin with those characters.

Regarding how to make a feature request please checkout https://developers.google.com/apps-script/support#missing_features

Upvotes: 0

Mani
Mani

Reputation: 1

DocBody.setMarginTop() should do the job, if I understand your question correctly.

Upvotes: -1

Related Questions