class DocumentApp method .appendParagraph()

DocumentApp is the Apps Script service.

.appendParagraph() is the method name you will see after a dot in your code.

What it does

Adds a new paragraph to the end of the document.

Why it's used

  • Add a closing paragraph or signature block at the end.
  • Log each run as a new line in a running journal doc.

Common errors

  • Forgetting parentheses on appendParagraph. Write DocumentApp.appendParagraph(), not DocumentApp.appendParagraph or appendParagraph by itself.
  • Skipping dots between chained calls. Each step needs a dot, like DocumentApp.getActiveDocument().getBody().appendParagraph().
  • Adding spaces where they do not belong. Write DocumentApp.appendParagraph(), not DocumentApp .appendParagraph(), DocumentApp.appendParagraph (), or DocumentApp . appendParagraph().
  • Wrong capitalization. Use DocumentApp and appendParagraph, not documentapp or appendparagraph.

Explore

Related methods

  • .appendTable()

    Adds a new table to the end of the document.

  • .create()

    Creates a new blank Google Doc.

  • .setText()

    Replaces the text content of a document element.

  • .getBody()

    Returns the main body section of the document for editing.

  • .getText()

    Reads the plain text content of a document element.

Better Sheets tutorials

No tagged tutorials yet. Fetch Apps Script from the harvest table and this page fills automatically.

Related blog posts

Written guides about DocumentApp.appendParagraph().

Browse the blog